From: Gurusamy Sarathy Date: Wed, 4 Nov 1998 02:59:16 +0000 (+0000) Subject: fix return value of win32_pclose() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f1e745d9a1b9f298473c1ec14e5946d7ed2134f;p=p5sagit%2Fp5-mst-13.2.git fix return value of win32_pclose() p4raw-id: //depot/perl@2188 --- diff --git a/win32/win32.c b/win32/win32.c index 9e41d74..1ce7ad9 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 */ }