diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-15 06:38:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-05-15 06:38:46 +0000 |
commit | 4b0298134794cf25eb8a4c3a94d376545ca02f3c (patch) | |
tree | ed340b138673ce7cdfbbec0ebe340a36fe1f48cd /io.c | |
parent | 39ceaddfc9dbd85d51e4947867a91d23227a51e0 (diff) | |
download | ruby-4b0298134794cf25eb8a4c3a94d376545ca02f3c.tar.gz ruby-4b0298134794cf25eb8a4c3a94d376545ca02f3c.tar.xz ruby-4b0298134794cf25eb8a4c3a94d376545ca02f3c.zip |
2000-05-15
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1592,12 +1592,15 @@ rb_io_s_popen(argc, argv, self) Check_SafeStr(pname); port = pipe_open(RSTRING(pname)->ptr, mode); if (NIL_P(port)) { + /* child */ if (!NIL_P(proc)) { rb_eval_cmd(proc, rb_ary_new2(0)); + _exit(0); } - else { - rb_yield(port); + else if (rb_iterator_p()) { + rb_yield(Qnil); } + return Qnil; } else if (rb_iterator_p()) { return rb_ensure(rb_yield, port, rb_io_close, port); |