Fix stat(2) related bugs introduced by changes made for Windows
[fio.git] / init.c
diff --git a/init.c b/init.c
index 47519bf0666b32a8e784a274dacf11211f572e10..82b21c78568867d5fc901bc7e35eabcd7d38a714 100644 (file)
--- a/init.c
+++ b/init.c
@@ -911,10 +911,15 @@ static int exists_and_not_file(const char *filename)
        if (lstat(filename, &sb) == -1)
                return 0;
 
+#ifndef WIN32 /* NOT Windows */
+       if (S_ISREG(sb.st_mode))
+               return 0;
+#else
        /* \\.\ is the device namespace in Windows, where every file
         * is a device node */
        if (S_ISREG(sb.st_mode) && strncmp(filename, "\\\\.\\", 4) != 0)
                return 0;
+#endif
 
        return 1;
 }