1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* signal.c (ruby_signal): use SA_SIGINFO if available.

[ ruby-Patches-6418 ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-11-30 14:49:45 +00:00
parent 29c7c72e09
commit da42035b09
4 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Fri Nov 30 23:48:07 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* signal.c (ruby_signal): use SA_SIGINFO if available.
[ ruby-Patches-6418 ]
Fri Nov 30 22:52:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* signal.c (trap_signm): SIGVTALRM no longer used for green

View file

@ -472,7 +472,7 @@ VALUE rb_f_kill(int, VALUE*);
void rb_gc_mark_trap_list(void);
#ifdef POSIX_SIGNAL
#define posix_signal ruby_posix_signal
void posix_signal(int, RETSIGTYPE (*)(int));
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
#endif
void ruby_sig_finalize(void);
void rb_trap_exit(void);

View file

@ -1668,6 +1668,10 @@ rb_f_abort(int argc, VALUE *argv)
#if defined(sun)
#define signal(a,b) sigset(a,b)
#else
# if defined(POSIX_SIGNAL)
# define signal(a,b) posix_signal(a,b)
# endif
#endif
void

View file

@ -414,9 +414,15 @@ ruby_signal(int signum, sighandler_t handler)
rb_trap_accept_nativethreads[signum] = 0;
sigact.sa_handler = handler;
sigemptyset(&sigact.sa_mask);
#ifdef SA_SIGINFO
sigact.sa_sigaction = (void (*)(int, siginfo_t*, void*))handler;
sigact.sa_flags = SA_SIGINFO;
#else
sigact.sa_handler = handler;
sigact.sa_flags = 0;
#endif
#ifdef SA_NOCLDWAIT
if (signum == SIGCHLD && handler == SIG_IGN)
sigact.sa_flags |= SA_NOCLDWAIT;
@ -425,7 +431,7 @@ ruby_signal(int signum, sighandler_t handler)
return old.sa_handler;
}
void
sighandler_t
posix_signal(int signum, sighandler_t handler)
{
ruby_signal(signum, handler);