diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-04 02:59:16 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-04 02:59:16 +0000 |
commit | 8f1e745d9a1b9f298473c1ec14e5946d7ed2134f (patch) | |
tree | d26420970ce7d836ae1fec947d213399b9dc9a5e /win32 | |
parent | 07f14f5412398b0492274e922342ea9f308fea76 (diff) | |
download | perl-8f1e745d9a1b9f298473c1ec14e5946d7ed2134f.tar.gz |
fix return value of win32_pclose()
p4raw-id: //depot/perl@2188
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/win32/win32.c b/win32/win32.c index 9e41d74bdb..1ce7ad98bc 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1095,10 +1095,10 @@ win32_waitpid(int pid, int *status, int flags) return win32_wait(status); else { rc = cwait(status, pid, WAIT_CHILD); - /* cwait() returns differently on Borland */ -#ifdef __BORLANDC__ + /* cwait() returns "correctly" on Borland */ +#ifndef __BORLANDC__ if (status) - *status = (((*status >> 8) & 0xff) | ((*status << 8) & 0xff00)); + *status *= 256; #endif remove_dead_process((HANDLE)pid); } @@ -1751,12 +1751,11 @@ win32_pclose(FILE *pf) /* wait for the child */ if (cwait(&status, childpid, WAIT_CHILD) == -1) return (-1); - /* cwait() returns differently on Borland */ -#ifdef __BORLANDC__ - return (((status >> 8) & 0xff) | ((status << 8) & 0xff00)); -#else - return (status); + /* cwait() returns "correctly" on Borland */ +#ifndef __BORLANDC__ + status *= 256; #endif + return (status); #endif /* USE_RTL_POPEN */ } |