Use the rb_sys_fail_str macro in signal.c

Let signal.c include "internal/error.h" explicitly to ensure that the
identifier rb_sys_fail_str in signal.c refers to the macro defined in
"internal/error.h" instead of the actual function.

That macro reads errno before evaluating its argument.  Without this
change, the rb_signo2signm(sig) expression in the "trap" function in
signal.c will overwrite the errno before the actual rb_sys_fail_str
function reads the errno.
This commit is contained in:
Kunshan Wang 2023-05-15 12:08:00 +08:00 коммит произвёл Nobuyoshi Nakada
Родитель 8bd4d8867a
Коммит c7067ed13d
2 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -14436,6 +14436,7 @@ signal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
signal.$(OBJEXT): $(top_srcdir)/internal/array.h
signal.$(OBJEXT): $(top_srcdir)/internal/basic_operators.h
signal.$(OBJEXT): $(top_srcdir)/internal/compilers.h
signal.$(OBJEXT): $(top_srcdir)/internal/error.h
signal.$(OBJEXT): $(top_srcdir)/internal/eval.h
signal.$(OBJEXT): $(top_srcdir)/internal/gc.h
signal.$(OBJEXT): $(top_srcdir)/internal/imemo.h

Просмотреть файл

@ -36,6 +36,7 @@
#include "debug_counter.h"
#include "eval_intern.h"
#include "internal.h"
#include "internal/error.h"
#include "internal/eval.h"
#include "internal/sanitizers.h"
#include "internal/signal.h"