mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2a1b0ff232
commit
e9cf3b3bf5
4 changed files with 16 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Nov 13 19:02:08 2000 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* win32/win32.c, io.c, process.c: the exit status of program must be
|
||||
multiplied 256 on mswin32 and msdosdjgpp(system(), ``).
|
||||
|
||||
Sat Nov 11 22:57:38 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* parse.y (arg): uniformed treatment of -a**b, where a is a
|
||||
|
|
2
io.c
2
io.c
|
@ -1519,7 +1519,7 @@ pipe_finalize(fptr)
|
|||
status = pclose(fptr->f2);
|
||||
}
|
||||
fptr->f = fptr->f2 = 0;
|
||||
#if defined DJGPP || (defined NT && !defined __BORLANDC__)
|
||||
#if defined DJGPP
|
||||
status <<= 8;
|
||||
#endif
|
||||
rb_last_status = INT2FIX(status);
|
||||
|
|
|
@ -657,7 +657,7 @@ rb_f_system(argc, argv)
|
|||
|
||||
Check_SafeStr(cmd);
|
||||
state = system(RSTRING(cmd)->ptr);
|
||||
rb_last_status = INT2FIX(state);
|
||||
rb_last_status = INT2FIX((state & 0xff) << 8);
|
||||
|
||||
if (state == 0) return Qtrue;
|
||||
return Qfalse;
|
||||
|
|
|
@ -653,7 +653,7 @@ mypclose(FILE *fp)
|
|||
MyPopenRecord[i].pipe = NULL;
|
||||
MyPopenRecord[i].pid = 0;
|
||||
|
||||
return exitcode;
|
||||
return (int)((exitcode & 0xff) << 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -673,7 +673,7 @@ char *cmd;
|
|||
register char **a;
|
||||
register char *s;
|
||||
char **argv;
|
||||
int status;
|
||||
int status = -1;
|
||||
char *shell, *cmd2;
|
||||
int mode = NtSyncProcess ? P_WAIT : P_NOWAIT;
|
||||
|
||||
|
@ -703,13 +703,13 @@ char *cmd;
|
|||
status = spawnvpe(mode, argv[0], argv, environ);
|
||||
/* return spawnle(mode, shell, shell, "-c", cmd, (char*)0, environ); */
|
||||
free(cmdline);
|
||||
return status;
|
||||
return (int)((status & 0xff) << 8);
|
||||
}
|
||||
}
|
||||
else if ((shell = getenv("COMSPEC")) != 0) {
|
||||
if (NtHasRedirection(cmd) /* || isInternalCmd(cmd) */) {
|
||||
do_comspec_shell:
|
||||
return spawnle(mode, shell, shell, "/c", cmd, (char*)0, environ);
|
||||
status = spawnle(mode, shell, shell, "/c", cmd, (char*)0, environ);
|
||||
return (int)((status & 0xff) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -735,7 +735,7 @@ char *cmd;
|
|||
}
|
||||
free(cmd2);
|
||||
free(argv);
|
||||
return status;
|
||||
return (int)((status & 0xff) << 8);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -2344,6 +2344,9 @@ waitpid (pid_t pid, int *stat_loc, int options)
|
|||
}
|
||||
if (WaitForSingleObject((HANDLE) pid, timeout) == WAIT_OBJECT_0) {
|
||||
pid = _cwait(stat_loc, pid, 0);
|
||||
#if !defined __BORLANDC__
|
||||
*stat_loc <<= 8;
|
||||
#endif
|
||||
return pid;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue