ruby-changes:23967
From: akr <ko1@a...>
Date: Sun, 10 Jun 2012 20:25:05 +0900 (JST)
Subject: [ruby-changes:23967] akr:r36018 (trunk): * process.c (rb_fork_ruby): new function.
akr 2012-06-10 20:21:07 +0900 (Sun, 10 Jun 2012) New Revision: 36018 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36018 Log: * process.c (rb_fork_ruby): new function. (rb_f_fork): use rb_fork_ruby instead of rb_fork. (rb_daemon): ditto. * io.c (pipe_open): use rb_fork_ruby instead of rb_fork. * internal.h (rb_fork_ruby): declared. Modified files: trunk/ChangeLog trunk/internal.h trunk/io.c trunk/process.c Index: ChangeLog =================================================================== --- ChangeLog (revision 36017) +++ ChangeLog (revision 36018) @@ -1,3 +1,13 @@ +Sun Jun 10 20:19:40 2012 Tanaka Akira <akr@f...> + + * process.c (rb_fork_ruby): new function. + (rb_f_fork): use rb_fork_ruby instead of rb_fork. + (rb_daemon): ditto. + + * io.c (pipe_open): use rb_fork_ruby instead of rb_fork. + + * internal.h (rb_fork_ruby): declared. + Sun Jun 10 18:58:16 2012 Akinori MUSHA <knu@i...> * lib/net/http/response.rb: Remove a duplicated rdoc and leave a Index: io.c =================================================================== --- io.c (revision 36017) +++ io.c (revision 36018) @@ -5541,7 +5541,7 @@ pid = rb_fork_async_signal_safe(&status, popen_exec, &arg, arg.execp->redirect_fds, errmsg, sizeof(errmsg)); } else { - pid = rb_fork(&status, 0, 0, Qnil); + pid = rb_fork_ruby(&status); if (pid == 0) { /* child */ rb_thread_atfork(); popen_redirect(&arg); Index: process.c =================================================================== --- process.c (revision 36017) +++ process.c (revision 36018) @@ -3011,6 +3011,12 @@ } +rb_pid_t +rb_fork_ruby(int *status) +{ + return rb_fork(status, NULL, NULL, Qnil); +} + #endif #if defined(HAVE_FORK) && !defined(CANNOT_FORK_WITH_PTHREAD) @@ -3044,7 +3050,7 @@ rb_secure(2); - switch (pid = rb_fork(0, 0, 0, Qnil)) { + switch (pid = rb_fork_ruby(NULL)) { case 0: rb_thread_atfork(); if (rb_block_given_p()) { @@ -5241,7 +5247,7 @@ #else int n; - switch (rb_fork(0, 0, 0, Qnil)) { + switch (rb_fork_ruby(NULL)) { case -1: rb_sys_fail("daemon"); case 0: @@ -5253,7 +5259,7 @@ proc_setsid(); /* must not be process-leader */ - switch (rb_fork(0, 0, 0, Qnil)) { + switch (rb_fork_ruby(NULL)) { case -1: return -1; case 0: Index: internal.h =================================================================== --- internal.h (revision 36017) +++ internal.h (revision 36018) @@ -166,6 +166,8 @@ #define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2) #define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1) +rb_pid_t rb_fork_ruby(int *status); + /* rational.c */ VALUE rb_lcm(VALUE x, VALUE y); VALUE rb_rational_reciprocal(VALUE x); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/