MinGW
[oweals/gnunet.git] / src / util / disk.c
index 7109355163e07106db9028f7046975dbeb56ec25..588ecae3cc5dd3b606013032f8ee06d8425cc28c 100644 (file)
@@ -1208,7 +1208,7 @@ GNUNET_DISK_file_open (const char *fn,
       return NULL;
     }
   if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)
-    oflags |= (O_CREAT & O_EXCL);
+    oflags |= (O_CREAT | O_EXCL);
   if (flags & GNUNET_DISK_OPEN_TRUNCATE)
     oflags |= O_TRUNC;
   if (flags & GNUNET_DISK_OPEN_APPEND)
@@ -1239,7 +1239,10 @@ GNUNET_DISK_file_open (const char *fn,
   fd = open (expfn, oflags | O_LARGEFILE, mode);
   if (fd == -1)
     {
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
+      if (0 == (flags & GNUNET_DISK_OPEN_FAILIFEXISTS))
+       GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
+      else
+       GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_DEBUG, "open", expfn);
       GNUNET_free (expfn);
       return NULL;
     }
@@ -1675,10 +1678,12 @@ GNUNET_DISK_pipe (int blocking)
  * Closes an interprocess channel
  *
  * @param p pipe to close
+ * @param end which end of the pipe to close
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
 int
-GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, enum GNUNET_DISK_PipeEnd end)
+GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
+                           enum GNUNET_DISK_PipeEnd end)
 {
   int ret = GNUNET_OK;
   int save;
@@ -1779,8 +1784,10 @@ GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p)
 
 /**
  * Get the handle to a particular pipe end
+ *
  * @param p pipe
  * @param n end to access
+ * @return handle for the respective end
  */
 const struct GNUNET_DISK_FileHandle *
 GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p,