aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 49e1bcfa4..6ad514ad4 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -239,9 +239,11 @@ int mingw_open (const char *filename, int oflags, ...)
239 return fd; 239 return fd;
240 } 240 }
241 241
242 va_start(args, oflags); 242 if ((oflags & O_CREAT)) {
243 mode = va_arg(args, int); 243 va_start(args, oflags);
244 va_end(args); 244 mode = va_arg(args, int);
245 va_end(args);
246 }
245 247
246 pmode = ((mode & S_IWUSR) ? _S_IWRITE : 0) | 248 pmode = ((mode & S_IWUSR) ? _S_IWRITE : 0) |
247 ((mode & S_IRUSR) ? _S_IREAD : 0); 249 ((mode & S_IRUSR) ? _S_IREAD : 0);