- fix
[oweals/gnunet.git] / src / util / disk.c
index 47325fe4e78bf3af15c7d66b1f212854ff540e3c..e2c3594e50bdb8aa6c10541db224eba8d25455d2 100644 (file)
@@ -1866,7 +1866,7 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
   return ret;
 }
 
-#ifndef WINDOWS
+#ifdef WINDOWS
 /**
  * Get a GNUnet file handle from a W32 handle.
  *
@@ -1921,7 +1921,7 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh)
 /**
  * Get a handle from a native integer FD.
  *
- * @param fd native integer file descriptor
+ * @param fno native integer file descriptor
  * @return file handle corresponding to the descriptor
  */
 struct GNUNET_DISK_FileHandle *
@@ -2258,9 +2258,8 @@ create_selectable_pipe (PHANDLE read_pipe_ptr, PHANDLE write_pipe_ptr,
      * a waste, since only a single direction is actually used.
      * It's important to only allow a single instance, to ensure that
      * the pipe was not created earlier by some other process, even if
-     * the pid has been reused.  We avoid FILE_FLAG_FIRST_PIPE_INSTANCE
-     * because that is only available for Win2k SP2 and WinXP.  */
-    read_pipe = CreateNamedPipeA (pipename, PIPE_ACCESS_INBOUND | dwReadMode, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1,   /* max instances */
+     * the pid has been reused.  */
+    read_pipe = CreateNamedPipeA (pipename, PIPE_ACCESS_INBOUND | FILE_FLAG_FIRST_PIPE_INSTANCE | dwReadMode, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1,   /* max instances */
                                   psize,        /* output buffer size */
                                   psize,        /* input buffer size */
                                   NMPWAIT_USE_DEFAULT_WAIT, sa_ptr);