diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/System/Win32/Program.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/System/Win32/Program.inc b/lib/System/Win32/Program.inc index 67965d1b69..4c520918bd 100644 --- a/lib/System/Win32/Program.inc +++ b/lib/System/Win32/Program.inc @@ -86,7 +86,7 @@ static HANDLE RedirectIO(const Path *path, int fd) { sa.bInheritHandle = TRUE; h = CreateFile(fname, fd ? GENERIC_WRITE : GENERIC_READ, FILE_SHARE_READ, - &sa, fd ? OPEN_EXISTING : CREATE_ALWAYS, + &sa, fd == 0 ? OPEN_EXISTING : CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) { ThrowError(std::string(fname) + ": Can't open file for " + |