summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-15 06:38:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-15 06:38:46 +0000
commit4b0298134794cf25eb8a4c3a94d376545ca02f3c (patch)
treeed340b138673ce7cdfbbec0ebe340a36fe1f48cd /io.c
parent39ceaddfc9dbd85d51e4947867a91d23227a51e0 (diff)
downloadruby-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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/io.c b/io.c
index 075644abe..af011b3a0 100644
--- a/io.c
+++ b/io.c
@@ -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);