summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 05:03:51 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 05:03:51 +0000
commit9c4182b89ea71417de430943d895017d5fb2f22a (patch)
tree41f6bcad1d42d1dbb406407ddf230d5511c8f658
parentda9a9c68fd91ad541c1fa211f66a3fb511ecdc03 (diff)
* process.c (detach_process_watcher): should not pass the pointer
to an auto variable to the thread to be created. pointed and fix by KUBO Takehiro <kubo at jiubao.org> [ruby-dev:30618] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@13359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--process.c13
-rw-r--r--version.h2
3 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 602663b5fa..3bb6a98edd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Sep 7 14:02:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (detach_process_watcher): should not pass the pointer
+ to an auto variable to the thread to be created. pointed and
+ fix by KUBO Takehiro <kubo at jiubao.org> [ruby-dev:30618]
+
Fri Sep 7 13:52:36 2007 Tanaka Akira <akr@fsij.org>
* bignum.c (big_lshift): make shift offset long type.
diff --git a/process.c b/process.c
index 00b557b379..079b2b913d 100644
--- a/process.c
+++ b/process.c
@@ -848,23 +848,22 @@ proc_waitall()
}
static VALUE
-detach_process_watcher(pid_p)
- int *pid_p;
+detach_process_watcher(arg)
+ void *arg;
{
- int cpid, status;
+ int pid = (int)arg, status;
- for (;;) {
- cpid = rb_waitpid(*pid_p, &status, WNOHANG);
- if (cpid != 0) return Qnil;
+ while (rb_waitpid(pid, &status, WNOHANG) == 0) {
rb_thread_sleep(1);
}
+ return Qnil;
}
VALUE
rb_detach_process(pid)
int pid;
{
- return rb_thread_create(detach_process_watcher, (void*)&pid);
+ return rb_thread_create(detach_process_watcher, (void*)pid);
}
diff --git a/version.h b/version.h
index 264ad000eb..cb0c497328 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-09-07"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20070907
-#define RUBY_PATCHLEVEL 99
+#define RUBY_PATCHLEVEL 100
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8