[#45085] [ruby-trunk - Feature #5839][Open] Proposal: Bitmap Marking GC — Narihiro Nakamura <authorNari@...>

11 messages 2012/01/04

[ruby-dev:45076] [Backport93 - Backport #2642][Assigned] PTY.check is broken

From: Motohiro KOSAKI <kosaki.motohiro@...>
Date: 2012-01-03 01:01:50 UTC
List: ruby-dev #45076
Issue #2642 has been updated by Motohiro KOSAKI.

Status changed from Closed to Assigned

I've commited r33468 into ruby_1_9_3 as r34183.

----------------------------------------
Backport #2642: PTY.check is broken
https://bugs.ruby-lang.org/issues/2642

Author: Nobuyoshi Nakada
Status: Assigned
Priority: Low
Assignee: Yuki Sonoda
Category: 
Target version: 


=begin
 なかだです。
 
 PTY.checkがいろいろと壊れているような気がします。
 
 * r20298によると PTY.check(pid) to poll program termination. と
   いうことなのに終了まで待ち続ける
 * メソッド本体なのにint statusを返している
 * pid_tを期待するraise_from_check()にVALUEを渡している
 
 
 Index: ext/pty/pty.c
 ===================================================================
 --- ext/pty/pty.c	(revision 26395)
 +++ ext/pty/pty.c	(working copy)
 @@ -606,9 +606,9 @@ pty_check(int argc, VALUE *argv, VALUE s
  
      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 */
  }
 
 
 -- 
 --- 僕の前にBugはない。
 --- 僕の後ろにBugはできる。
     中田 伸悦
=end



-- 
http://redmine.ruby-lang.org

In This Thread

Prev Next