diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-11-13 10:11:31 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-11-13 10:11:31 +0000 |
commit | f68806890907244281079fccb61fdd29b3ddc8e6 (patch) | |
tree | 259d2feaf2b84b2ef99ca34eef43d465a3134620 /win32/win32.c | |
parent | ee163b4ebf8f30f133e33a45cf8c879a3b5a09e9 (diff) | |
download | ruby-f68806890907244281079fccb61fdd29b3ddc8e6.tar.gz ruby-f68806890907244281079fccb61fdd29b3ddc8e6.tar.xz ruby-f68806890907244281079fccb61fdd29b3ddc8e6.zip |
eban
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/win32/win32.c b/win32/win32.c index a2b256d74..7a2dea884 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -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; |