From: Simon Marlow Date: Wed, 20 May 2009 13:09:26 +0000 (+0000) Subject: add _O_NOINHERIT when opening files on Windows (see #2650) X-Git-Tag: 2009-06-25~33 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=622a47367a0e9cff920c315964c2070059716e9a;p=ghc-base.git add _O_NOINHERIT when opening files on Windows (see #2650) --- diff --git a/include/HsBase.h b/include/HsBase.h index b749c58..afbff12 100644 --- a/include/HsBase.h +++ b/include/HsBase.h @@ -688,9 +688,11 @@ INLINE int __hscore_hs_fileno (FILE *f) { return fileno (f); } INLINE int __hscore_open(char *file, int how, mode_t mode) { #ifdef __MINGW32__ if ((how & O_WRONLY) || (how & O_RDWR) || (how & O_APPEND)) - return _sopen(file,how,_SH_DENYRW,mode); + return _sopen(file,how | _O_NOINHERIT,_SH_DENYRW,mode); + // _O_NOINHERIT: see #2650 else - return _sopen(file,how,_SH_DENYWR,mode); + return _sopen(file,how | _O_NOINHERIT,_SH_DENYWR,mode); + // _O_NOINHERIT: see #2650 #else return open(file,how,mode); #endif