зеркало из https://github.com/github/ruby.git
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a9e8b77697
Коммит
4b70fab915
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Sun Jun 10 20:19:40 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* 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@iDaemons.org>
|
||||
|
||||
* lib/net/http/response.rb: Remove a duplicated rdoc and leave a
|
||||
|
|
|
@ -166,6 +166,8 @@ st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
|
|||
#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);
|
||||
|
|
2
io.c
2
io.c
|
@ -5541,7 +5541,7 @@ pipe_open(struct rb_exec_arg *eargp, const char *modestr, int fmode, convconfig_
|
|||
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);
|
||||
|
|
12
process.c
12
process.c
|
@ -3011,6 +3011,12 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
|
|||
|
||||
}
|
||||
|
||||
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_f_fork(VALUE obj)
|
|||
|
||||
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 @@ rb_daemon(int nochdir, int noclose)
|
|||
#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 @@ rb_daemon(int nochdir, int noclose)
|
|||
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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче