summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-27 08:04:17 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-27 08:04:17 +0000
commitb181b6fb157975572d5e0c5c46c1594e317a45ba (patch)
tree4e1adf19655a9abff6288cbcc360c988f9b8ade8 /win32
parenta45bd81d7bee5835ad83b5249bac63256f8c94c0 (diff)
downloadperl-b181b6fb157975572d5e0c5c46c1594e317a45ba.tar.gz
add missing flag in change#4892
p4raw-link: @4892 on //depot/perl: 9e5f57defb0d4fe4a23e6e24c3d57478465aea87 p4raw-id: //depot/perl@4911
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c7621157cf..af5e454f27 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 */