Skip to content

Commit

Permalink
* process.c (rb_spawn_internal): use int variable for status.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Mar 14, 2009
1 parent ba8fbae commit e368a2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Sat Mar 14 15:59:04 2009 Tanaka Akira <[email protected]>

* process.c (rb_spawn_internal): use int variable for status.

Sat Mar 14 14:45:51 2009 Tanaka Akira <[email protected]>

* process.c (rb_f_system): use rb_pid_t for pid.
Expand Down
7 changes: 4 additions & 3 deletions process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit e368a2e

Please sign in to comment.