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

ruby-changes:20130

From: kosaki <ko1@a...>
Date: Mon, 20 Jun 2011 22:55:12 +0900 (JST)
Subject: [ruby-changes:20130] kosaki:r32178 (trunk): * process.c (before_exec): use sig_do_nothing instead of SIG_DFL

kosaki	2011-06-20 22:55:04 +0900 (Mon, 20 Jun 2011)

  New Revision: 32178

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

  Log:
    * process.c (before_exec): use sig_do_nothing instead of SIG_DFL
      for avoiding a race.
    * process.c (sig_do_nothing): new function.

  Modified files:
    trunk/ChangeLog
    trunk/process.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32177)
+++ ChangeLog	(revision 32178)
@@ -1,3 +1,9 @@
+Mon Jun 20 22:52:07 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* process.c (before_exec): use sig_do_nothing instead of SIG_DFL
+	  for avoiding a race.
+	* process.c (sig_do_nothing): new function.
+
 Mon Jun 20 21:31:03 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread_pthread.c (thread_timer): rename timeout_10ms to
Index: process.c
===================================================================
--- process.c	(revision 32177)
+++ process.c	(revision 32178)
@@ -984,6 +984,12 @@
 # define signal(a,b) posix_signal((a),(b))
 #endif
 
+#ifdef SIGPIPE
+static RETSIGTYPE sig_do_nothing(int sig)
+{
+}
+#endif
+
 static void before_exec(void)
 {
     /*
@@ -999,7 +1005,7 @@
      * child process interaction might fail. (e.g. ruby -e "system 'yes | ls'")
      * [ruby-dev:12261]
      */
-    saved_sigpipe_handler = signal(SIGPIPE, SIG_DFL);
+    saved_sigpipe_handler = signal(SIGPIPE, sig_do_nothing);
 #endif
 
     if (!forked_child) {

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

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