зеркало из https://github.com/github/ruby.git
* process.c (rb_spawn_internal): use int variable for status.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ba8fbae364
Коммит
e368a2e158
|
@ -1,3 +1,7 @@
|
|||
Sat Mar 14 15:59:04 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (rb_spawn_internal): use int variable for status.
|
||||
|
||||
Sat Mar 14 14:45:51 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (rb_f_system): use rb_pid_t for pid.
|
||||
|
|
|
@ -2838,6 +2838,7 @@ rb_spawn_internal(int argc, VALUE *argv, int default_close_others,
|
|||
char *errmsg, size_t errmsg_buflen)
|
||||
{
|
||||
rb_pid_t pid;
|
||||
int status;
|
||||
VALUE prog;
|
||||
struct rb_exec_arg earg;
|
||||
#if !defined HAVE_FORK
|
||||
|
@ -2852,7 +2853,7 @@ rb_spawn_internal(int argc, VALUE *argv, int default_close_others,
|
|||
rb_exec_arg_fixup(&earg);
|
||||
|
||||
#if defined HAVE_FORK
|
||||
pid = rb_fork_err(&pid, rb_exec_atfork, &earg, earg.redirect_fds, errmsg, errmsg_buflen);
|
||||
pid = rb_fork_err(&status, rb_exec_atfork, &earg, earg.redirect_fds, errmsg, errmsg_buflen);
|
||||
if (prog && earg.argc) earg.argv[0] = prog;
|
||||
#else
|
||||
if (rb_run_exec_options_err(&earg, &sarg, errmsg, errmsg_buflen) < 0) {
|
||||
|
@ -2875,8 +2876,8 @@ rb_spawn_internal(int argc, VALUE *argv, int default_close_others,
|
|||
# endif
|
||||
# else
|
||||
if (argc) prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
|
||||
pid = system(StringValuePtr(prog));
|
||||
rb_last_status_set((pid & 0xff) << 8, 0);
|
||||
status = system(StringValuePtr(prog));
|
||||
rb_last_status_set((status & 0xff) << 8, 0);
|
||||
# endif
|
||||
|
||||
rb_run_exec_options_err(&sarg, NULL, errmsg, errmsg_buflen);
|
||||
|
|
Загрузка…
Ссылка в новой задаче