]> git.sur5r.net Git - bacula/bacula/commitdiff
S_ISBLK for Win32 + small bugfix of S_ISREG and S_ISDIR
authorThorsten Engel <thorsten.engel@matrix-computer.com>
Tue, 12 Jul 2005 16:03:32 +0000 (16:03 +0000)
committerThorsten Engel <thorsten.engel@matrix-computer.com>
Tue, 12 Jul 2005 16:03:32 +0000 (16:03 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2192 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/compat/compat.h

index 7a2eb7de43842576e2da58cdb7ddf5f568edf400..abf97b796a90109a7c63638927c1f9676881e3bc 100644 (file)
@@ -193,6 +193,7 @@ struct stat
 #undef  S_IFDIR
 #define S_IFDIR        0040000         /* directory */
 #define S_IFCHR        0020000         /* character special */
+#define        S_IFBLK        0060000         /* block special */
 #define S_IFIFO        0010000         /* pipe */
 #undef  S_IFREG
 #define S_IFREG        0100000         /* regular */
@@ -203,10 +204,10 @@ struct stat
 #define S_IRUSR         S_IREAD
 #define S_IWUSR         S_IWRITE
 #define S_IXUSR         S_IEXEC
-#define S_ISREG(x)  (((x) & S_IFREG) == S_IFREG)
-#define S_ISDIR(x)  (((x) & S_IFDIR) == S_IFDIR)
+#define S_ISREG(x)  (((x) & S_IFMT) == S_IFREG)
+#define S_ISDIR(x)  (((x) & S_IFMT) == S_IFDIR)
 #define S_ISCHR(x) 0
-#define S_ISBLK(x) 0
+#define S_ISBLK(x)  (((x) & S_IFMT) == S_IFBLK)
 #define S_ISFIFO(x) 0
 #endif //HAVE_MINGW