diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-04 08:55:54 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-04 08:55:54 +0000 |
| commit | 53bbf0599f87f2b9db4ab373a28df4b68828d0e4 (patch) | |
| tree | 57913d4ffbc8b0c16c7e12118aaca2c4adca8052 | |
| parent | 4bab25cada1bbddff3d7699e8cfc15a5b1954872 (diff) | |
| download | ruby-53bbf0599f87f2b9db4ab373a28df4b68828d0e4.tar.gz ruby-53bbf0599f87f2b9db4ab373a28df4b68828d0e4.tar.xz ruby-53bbf0599f87f2b9db4ab373a28df4b68828d0e4.zip | |
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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | ext/curses/curses.c | 2 | ||||
| -rw-r--r-- | signal.c | 8 |
3 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,10 @@ +Thu Dec 4 13:56:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * 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. + Thu Dec 4 11:38:40 2008 Akinori MUSHA <knu@iDaemons.org> * vm_method.c (rb_obj_respond_to): Remove a duplicated rdoc diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 778bee4da..928c403a8 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -416,7 +416,7 @@ curses_getch(VALUE obj) curses_stdscr(); c = getch(); if (c == EOF) return Qnil; - if (ISPRINT(c)) { + if (rb_isprint(c)) { char ch = (char)c; return rb_locale_str_new(&ch, 1); @@ -15,6 +15,7 @@ #include "vm_core.h" #include <signal.h> #include <stdio.h> +#include <errno.h> #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; } |
