summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-21 16:29:51 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-21 16:29:51 +0000
commit031cab4d2f1c4f854d988fe152853052888186cd (patch)
treed5f623425a095fdd7acdfb61e998ebd99c65e947 /process.c
parente99cc37db444046e94d25b7aec324c707c9bfdd2 (diff)
* eval.c (thread_timer, rb_thread_stop_timer): check the timing of
stopping timer. patch from KOSAKI Motohiro <kosaki.motohiro _AT_ jp.fujitsu.com> * eval.c (rb_thread_start_timer): NetBSD5 seems to be hung when calling pthread_create() from pthread_atfork()'s parent handler. * io.c (pipe_open): workaround for NetBSD5. stop timer thread before fork(), and start it if needed. * process.c (rb_f_fork, rb_f_system): ditto. fixed [ruby-dev:40074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/process.c b/process.c
index 8806bf1a77..ba02685ca2 100644
--- a/process.c
+++ b/process.c
@@ -1331,7 +1331,14 @@ rb_f_fork(obj)
fflush(stderr);
#endif
+#ifdef __NetBSD__
+ before_exec();
+ pid = fork();
+ after_exec();
+ switch (pid) {
+#else
switch (pid = fork()) {
+#endif
case 0:
#ifdef linux
after_exec();
@@ -1571,6 +1578,9 @@ rb_f_system(argc, argv)
chfunc = signal(SIGCHLD, SIG_DFL);
retry:
+#ifdef __NetBSD__
+ before_exec();
+#endif
pid = fork();
if (pid == 0) {
/* child process */
@@ -1578,6 +1588,9 @@ rb_f_system(argc, argv)
rb_protect(proc_exec_args, (VALUE)&earg, NULL);
_exit(127);
}
+#ifdef __NetBSD__
+ after_exec();
+#endif
if (pid < 0) {
if (errno == EAGAIN) {
rb_thread_sleep(1);