From 1f3c6d2d82721ae1766769ae537048d2f44773f9 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 4 Dec 2008 08:55:54 +0000 Subject: merges r20482 from trunk into ruby_1_9_1. * ext/curses/curses.c (window_getch): avoid ISPRINT() macro which has an issue with OpenSolaris. [ruby-core:20189] * signal.c (ruby_signal): EINVAL from sigaction(2) is not a bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- signal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'signal.c') diff --git a/signal.c b/signal.c index cb2fcb3557..91aa7c418e 100644 --- a/signal.c +++ b/signal.c @@ -15,6 +15,7 @@ #include "vm_core.h" #include #include +#include #ifdef _WIN32 typedef LONG rb_atomic_t; @@ -474,8 +475,11 @@ ruby_signal(int signum, sighandler_t handler) if (signum == SIGSEGV) sigact.sa_flags |= SA_ONSTACK; #endif - if (sigaction(signum, &sigact, &old) < 0) - rb_bug("sigaction error.\n"); + if (sigaction(signum, &sigact, &old) < 0) { + if (errno != 0 && errno != EINVAL) { + rb_bug("sigaction error.\n"); + } + } return old.sa_handler; } -- cgit v1.2.3