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 | b2dc4932bf9b5b77a2def58c80ccd93396b28b13 (patch) | |
tree | ed340b138673ce7cdfbbec0ebe340a36fe1f48cd /io.c | |
parent | 693599714a16c085f912dcddde16f52a18d2858b (diff) | |
download | ruby-b2dc4932bf9b5b77a2def58c80ccd93396b28b13.tar.gz |
2000-05-15
git-svn-id: svn+ssh://ci.ruby-lang.org/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); |