aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 0863dc841..d6cd25107 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -156,14 +156,8 @@ static int rand_fd = -1;
156 */ 156 */
157int get_dev_type(const char *filename) 157int get_dev_type(const char *filename)
158{ 158{
159 int i; 159 if (filename && !strncmp(filename, "/dev/", 5))
160 160 return index_in_strings("null\0zero\0urandom\0", filename+5);
161 if (filename && !strncmp(filename, "/dev/", 5)) {
162 i = index_in_strings("null\0zero\0urandom\0", filename+5);
163 if (i != -1) {
164 return i;
165 }
166 }
167 161
168 return NOT_DEVICE; 162 return NOT_DEVICE;
169} 163}
@@ -186,7 +180,7 @@ int mingw_open (const char *filename, int oflags, ...)
186 int dev = get_dev_type(filename); 180 int dev = get_dev_type(filename);
187 181
188 /* /dev/null is always allowed, others only if O_SPECIAL is set */ 182 /* /dev/null is always allowed, others only if O_SPECIAL is set */
189 if (dev != NOT_DEVICE && (dev == DEV_NULL || special)) { 183 if (dev == DEV_NULL || (special && dev != NOT_DEVICE)) {
190 filename = "nul"; 184 filename = "nul";
191 oflags = O_RDWR; 185 oflags = O_RDWR;
192 } 186 }