Commit e92fd762 authored by Tomoyuki Sahara's avatar Tomoyuki Sahara

wait for child processes when we close pipes. fixes #37.

parent 3a97a453
......@@ -351,6 +351,13 @@ fptr_finalize(mrb_state *mrb, struct mrb_io *fptr, int noraise)
}
}
if (fptr->pid != 0) {
pid_t pid;
do {
pid = waitpid(fptr->pid, NULL, 0);
} while (pid == -1 && errno == EINTR);
}
if (!noraise && n != 0) {
mrb_sys_fail(mrb, "fptr_finalize failed.");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment