From: Gurusamy Sarathy Date: Thu, 27 Jan 2000 08:04:17 +0000 (+0000) Subject: add missing flag in change#4892 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b181b6fb157975572d5e0c5c46c1594e317a45ba;p=p5sagit%2Fp5-mst-13.2.git add missing flag in change#4892 p4raw-link: @4892 on //depot/perl: 9e5f57defb0d4fe4a23e6e24c3d57478465aea87 p4raw-id: //depot/perl@4911 --- diff --git a/win32/win32.c b/win32/win32.c index c762115..af5e454 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1797,6 +1797,7 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[]; #ifdef USE_FIXED_OSFHANDLE #define FOPEN 0x01 /* file handle open */ +#define FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */ #define FAPPEND 0x20 /* file handle opened O_APPEND */ #define FDEV 0x40 /* file handle refers to device */ #define FTEXT 0x80 /* file handle is in text mode */ @@ -1837,7 +1838,8 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[]; /* create an ioinfo entry, kill its handle, and steal the entry */ -static int _alloc_osfhnd() +static int +_alloc_osfhnd(void) { HANDLE hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL); int fh = _open_osfhandle((long)hF, 0); @@ -1863,6 +1865,9 @@ my_open_osfhandle(long osfhandle, int flags) if (flags & O_TEXT) fileflags |= FTEXT; + if (flags & O_NOINHERIT) + fileflags |= FNOINHERIT; + /* attempt to allocate a C Runtime file handle */ if ((fh = _alloc_osfhnd()) == -1) { errno = EMFILE; /* too many open files */ @@ -2671,7 +2676,8 @@ win32_dup2(int fd1,int fd2) #define FTEXT 0x80 /* file handle is in text mode */ #define MAX_DESCRIPTOR_COUNT (64*32) /* this is the maximun that MSVCRT can handle */ -int __cdecl _fixed_read(int fh, void *buf, unsigned cnt) +int __cdecl +_fixed_read(int fh, void *buf, unsigned cnt) { int bytes_read; /* number of bytes read */ char *buffer; /* buffer to read to */