Project

General

Profile

Actions

Backport #2642

closed

PTY.check is broken

Added by nobu (Nobuyoshi Nakada) over 14 years ago. Updated almost 8 years ago.

Status:
Rejected
[ruby-dev:40141]

Description

=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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0