fix
authorChristian Grothoff <christian@grothoff.org>
Mon, 22 Nov 2010 20:59:13 +0000 (20:59 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 22 Nov 2010 20:59:13 +0000 (20:59 +0000)
src/util/disk.c

index b7365648d5005c05ab4976623c9530b8b72fad55..0b37da8c2a978c06b4e7f01b1ec4b55c03545083 100644 (file)
@@ -1888,9 +1888,8 @@ GNUNET_DISK_npipe_open (const char *fn,
                        enum GNUNET_DISK_OpenFlags flags,
                        enum GNUNET_DISK_AccessPermissions perm)
 {
-  struct GNUNET_DISK_FileHandle *ret;
-
 #ifdef MINGW
+  struct GNUNET_DISK_FileHandle *ret;
   HANDLE h;
   DWORD openMode;
   char *name;
@@ -1921,11 +1920,10 @@ GNUNET_DISK_npipe_open (const char *fn,
 
   return ret;
 #else
-  int fd;
-
   if (mkfifo(fn, translate_unix_perms(perm)) == -1)
     {
-      if (errno == EEXIST && flags & GNUNET_DISK_OPEN_FAILIFEXISTS)
+      if ( (errno != EEXIST) ||
+          (0 != (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)) )
         return NULL;
     }