summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
commit75ff8fdb16fa0a733512e61350c9844ea530ad35 (patch)
treea057e60543c77d6e20ea2e91928928df80b2b6d3 /process.c
parent5d71c8d89c6bd7af934e7a8de5882cda2991711b (diff)
join 1.1c6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/process.c b/process.c
index 59e6c8bde3..d9229a47db 100644
--- a/process.c
+++ b/process.c
@@ -79,7 +79,7 @@ rb_waitpid(pid, flags, st)
{
int result;
#ifndef NO_WAITPID
-#if defined(THREAD)
+#if defined(USE_THREAD)
int oflags = flags;
if (!rb_thread_alone()) { /* there're other threads to run */
flags |= WNOHANG;
@@ -94,14 +94,14 @@ rb_waitpid(pid, flags, st)
#endif
if (result < 0) {
if (errno == EINTR) {
-#ifdef THREAD
+#ifdef USE_THREAD
rb_thread_schedule();
#endif
goto retry;
}
return -1;
}
-#ifdef THREAD
+#ifdef USE_THREAD
if (result == 0) {
if (oflags & WNOHANG) return 0;
rb_thread_schedule();
@@ -124,7 +124,7 @@ rb_waitpid(pid, flags, st)
result = wait(st);
if (result < 0) {
if (errno == EINTR) {
-#ifdef THREAD
+#ifdef USE_THREAD
rb_thread_schedule();
#endif
continue;
@@ -137,7 +137,7 @@ rb_waitpid(pid, flags, st)
if (!pid_tbl)
pid_tbl = st_init_numtable();
st_insert(pid_tbl, pid, st);
-#ifdef THREAD
+#ifdef USE_THREAD
if (!thread_alone()) rb_thread_schedule();
#endif
}
@@ -181,7 +181,7 @@ rb_f_wait()
while ((pid = wait(&state)) < 0) {
if (errno == EINTR) {
-#ifdef THREAD
+#ifdef USE_THREAD
rb_thread_schedule();
#endif
continue;
@@ -212,7 +212,7 @@ rb_f_waitpid(obj, vpid, vflags)
char *strtok();
-#if defined(THREAD) && defined(HAVE_SETITIMER)
+#if defined(USE_THREAD) && defined(HAVE_SETITIMER)
static void
before_exec()
{
@@ -725,7 +725,7 @@ rb_f_system(argc, argv)
case -1:
if (errno == EAGAIN) {
-#ifdef THREAD
+#ifdef USE_THREAD
rb_thread_sleep(1);
#else
sleep(1);
@@ -754,7 +754,7 @@ rb_f_sleep(argc, argv)
int beg, end;
beg = time(0);
-#ifdef THREAD
+#ifdef USE_THREAD
if (argc == 0) {
rb_thread_sleep_forever();
}
@@ -917,12 +917,12 @@ proc_setuid(obj, id)
int uid;
uid = NUM2INT(id);
-#ifdef HAVE_SETRUID
- setruid(uid);
-#else
#ifdef HAVE_SETREUID
setreuid(uid, -1);
#else
+#ifdef HAVE_SETRUID
+ setruid(uid);
+#else
{
if (geteuid() == uid)
setuid(uid);