summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-17 18:14:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-17 18:14:05 +0000
commit1b2d3f81ee00c3fc5f002aaf7a646ed08e605610 (patch)
treee0a3a8afd1fbda407b8e36749d4f84f7e1942c0a /process.c
parentd51bcd20071f6f61bce0364c81fb48e2c5b7d224 (diff)
1.6.2 (to be)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/process.c b/process.c
index a99e902..0675f8e 100644
--- a/process.c
+++ b/process.c
@@ -86,11 +86,13 @@ rb_waitpid(pid, flags, st)
}
retry:
+ TRAP_BEG;
#ifdef HAVE_WAITPID
result = waitpid(pid, st, flags);
#else /* HAVE_WAIT4 */
result = wait4(pid, st, flags, NULL);
#endif
+ TRAP_END;
if (result < 0) {
if (errno == EINTR) {
rb_thread_polling();
@@ -116,7 +118,9 @@ rb_waitpid(pid, flags, st)
}
for (;;) {
+ TRAP_BEG;
result = wait(st);
+ TRAP_END;
if (result < 0) {
if (errno == EINTR) {
rb_thread_schedule();
@@ -170,7 +174,11 @@ proc_wait()
return INT2FIX(data.pid);
}
- while ((pid = wait(&state)) < 0) {
+ while (1) {
+ TRAP_BEG;
+ pid = wait(&state);
+ TRA_END;
+ if (pid >= 0) break;
if (errno == EINTR) {
rb_thread_schedule();
continue;
@@ -218,7 +226,7 @@ proc_waitpid2(argc, argv)
int argc;
VALUE *argv;
{
- VALUE pid = proc_waitpid2(argc, argv);
+ VALUE pid = proc_waitpid(argc, argv);
return rb_assoc_new(pid, rb_last_status);
}