diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-18 06:59:36 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-18 06:59:36 +0000 |
commit | 35301f1941dc92a46f45884380e7cc30081d5b95 (patch) | |
tree | c268af56267dcc487f65cec821380293b37f4749 /win32/win32.c | |
parent | 938e3b7ddb7a3025041108c408f8ffaa79802d6d (diff) | |
download | ruby-35301f1941dc92a46f45884380e7cc30081d5b95.tar.gz ruby-35301f1941dc92a46f45884380e7cc30081d5b95.tar.xz ruby-35301f1941dc92a46f45884380e7cc30081d5b95.zip |
2000-02-18
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@621 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 877978db5..a1e6d25ff 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -546,15 +546,14 @@ mypopen (char *cmd, char *mode) if (lpCmd2) free(lpCmd2); - CloseHandle(aProcessInformation.hThread); - if (!fRet) { CloseHandle(hInFile); CloseHandle(hOutFile); - CloseHandle(aProcessInformation.hProcess); return NULL; } + CloseHandle(aProcessInformation.hThread); + if (reading) { fd = _open_osfhandle((long)hInFile, (_O_RDONLY | pipemode)); CloseHandle(hOutFile); @@ -1541,7 +1540,7 @@ typedef struct { #endif /* defined (_MT) && !defined (DLL_FOR_WIN32S) */ } ioinfo; -EXTERN_C ioinfo * __pioinfo[]; +EXTERN_C _CRTIMP ioinfo * __pioinfo[]; #define IOINFO_L2E 5 #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) @@ -1549,6 +1548,7 @@ EXTERN_C ioinfo * __pioinfo[]; #define _osfile(i) (_pioinfo(i)->osfile) #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 */ @@ -1568,6 +1568,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 */ @@ -2203,7 +2206,7 @@ gettimeofday(struct timeval *tv, struct timezone *tz) } char * -getcwd(buffer, size) +win32_getcwd(buffer, size) char *buffer; int size; { @@ -2218,7 +2221,7 @@ getcwd(buffer, size) return NULL; } - for (bp = buffer; *bp != '\0'; bp++) { + for (bp = buffer; *bp != '\0'; bp = CharNext(bp)) { if (*bp == '\\') { *bp = '/'; } |