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

ruby-changes:29395

From: nobu <ko1@a...>
Date: Thu, 20 Jun 2013 02:44:58 +0900 (JST)
Subject: [ruby-changes:29395] nobu:r41447 (trunk): win32.c: wait until exit

nobu	2013-06-20 02:44:47 +0900 (Thu, 20 Jun 2013)

  New Revision: 41447

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

  Log:
    win32.c: wait until exit
    
    * win32/win32.c (waitpid): should not return 0 but wait until exit
      unless WNOHANG is given.  waiting huge process may return while
      active, for some reason.

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41446)
+++ ChangeLog	(revision 41447)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 20 02:44:45 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* win32/win32.c (waitpid): should not return 0 but wait until exit
+	  unless WNOHANG is given.  waiting huge process may return while
+	  active, for some reason.
+
 Thu Jun 20 01:34:15 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (bdigit_roomof): Use SIZEOF_BDIGITS.
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 41446)
+++ win32/win32.c	(revision 41447)
@@ -4153,8 +4153,10 @@ waitpid(rb_pid_t pid, int *stat_loc, int https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4153
 	    /* wait... */
 	    if (rb_w32_wait_events_blocking(&child->hProcess, 1, timeout) != WAIT_OBJECT_0) {
 		/* still active */
-		pid = 0;
-		break;
+		if (options & WNOHANG) {
+		    pid = 0;
+		    break;
+		}
 	    }
 	}
     }

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

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