зеркало из https://github.com/github/ruby.git
pty.c: do nothing if terminated already
* ext/pty/pty.c (pty_detach_process): if the child process has terminated already, return immediately without starting a thread to detach it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
fba33accdb
Коммит
00f78058b6
|
@ -538,6 +538,11 @@ pty_open(VALUE klass)
|
|||
static VALUE
|
||||
pty_detach_process(struct pty_info *info)
|
||||
{
|
||||
#ifdef WNOHANG
|
||||
int st;
|
||||
if (rb_waitpid(info->child_pid, &st, WNOHANG) <= 0)
|
||||
return Qnil;
|
||||
#endif
|
||||
rb_detach_process(info->child_pid);
|
||||
return Qnil;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче