[前][次][番号順一覧][スレッド一覧]

ruby-changes:8946

From: matz <ko1@a...>
Date: Thu, 4 Dec 2008 13:58:18 +0900 (JST)
Subject: [ruby-changes:8946] Ruby:r20482 (trunk): * ext/curses/curses.c (window_getch): avoid ISPRINT() macro which

matz	2008-12-04 13:57:58 +0900 (Thu, 04 Dec 2008)

  New Revision: 20482

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20482

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/ext/curses/curses.c
    trunk/signal.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20481)
+++ ChangeLog	(revision 20482)
@@ -1,3 +1,10 @@
+Thu Dec  4 13:56:31 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* 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:40:56 2008  Akinori MUSHA  <knu@i...>
 
 	* enumerator.c (inspect_enumerator): Implement #inspect.
Index: ext/curses/curses.c
===================================================================
--- ext/curses/curses.c	(revision 20481)
+++ ext/curses/curses.c	(revision 20482)
@@ -416,7 +416,7 @@
     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);
Index: signal.c
===================================================================
--- signal.c	(revision 20481)
+++ signal.c	(revision 20482)
@@ -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 @@
     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;
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]