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

ruby-changes:14562

From: nobu <ko1@a...>
Date: Mon, 25 Jan 2010 17:47:20 +0900 (JST)
Subject: [ruby-changes:14562] Ruby:r26402 (trunk): * ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, and

nobu	2010-01-25 17:47:04 +0900 (Mon, 25 Jan 2010)

  New Revision: 26402

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

  Log:
    * ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, and
      call raise_from_check() with pid_t.  [ruby-dev:40141]

  Modified files:
    trunk/ChangeLog
    trunk/ext/pty/pty.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26401)
+++ ChangeLog	(revision 26402)
@@ -1,3 +1,8 @@
+Mon Jan 25 17:47:02 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, and
+	  call raise_from_check() with pid_t.  [ruby-dev:40141]
+
 Mon Jan 25 17:36:11 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* version.c (RUBY_LIB, RUBY_*_LIB): moved from configures.
Index: ext/pty/pty.c
===================================================================
--- ext/pty/pty.c	(revision 26401)
+++ ext/pty/pty.c	(revision 26402)
@@ -605,11 +605,11 @@
     int status;
 
     rb_scan_args(argc, argv, "11", &pid, &exc);
-    cpid = rb_waitpid(NUM2PIDT(pid), &status, WUNTRACED);
+    cpid = rb_waitpid(NUM2PIDT(pid), &status, WNOHANG|WUNTRACED);
     if (cpid == -1) return Qnil;
 
-    if (!RTEST(exc)) return status;
-    raise_from_check(pid, status);
+    if (!RTEST(exc)) return rb_last_status_get();
+    raise_from_check(cpid, status);
     return Qnil;		/* not reached */
 }
 

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

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