gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8586 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r8586 - in gnunet/src: include util
Date: Tue, 16 Jun 2009 12:35:50 -0600

Author: durner
Date: 2009-06-16 12:35:49 -0600 (Tue, 16 Jun 2009)
New Revision: 8586

Modified:
   gnunet/src/include/gnunet_disk_lib.h
   gnunet/src/util/disk.c
Log:
match older GNUNET_DISK_file_xxx functions

Modified: gnunet/src/include/gnunet_disk_lib.h
===================================================================
--- gnunet/src/include/gnunet_disk_lib.h        2009-06-16 18:16:12 UTC (rev 
8585)
+++ gnunet/src/include/gnunet_disk_lib.h        2009-06-16 18:35:49 UTC (rev 
8586)
@@ -153,7 +153,7 @@
  * @param fn file name
  * @param result the buffer to write the result to
  * @param len the maximum number of bytes to read
- * @return the number of bytes read on success, GNUNET_SYSERR on failure
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int GNUNET_DISK_fn_read (const char * const fn, void *result, int len);
 
@@ -163,7 +163,7 @@
  * @param h handle to open file
  * @param buffer the data to write
  * @param n number of bytes to write
- * @return number of bytes written on success, GNUNET_SYSERR on error
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int GNUNET_DISK_file_write (const struct GNUNET_IO_Handle *h, const void 
*buffer,
     unsigned int n);

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2009-06-16 18:16:12 UTC (rev 8585)
+++ gnunet/src/util/disk.c      2009-06-16 18:35:49 UTC (rev 8586)
@@ -435,7 +435,7 @@
  * @param fn file name
  * @param result the buffer to write the result to
  * @param len the maximum number of bytes to read
- * @return the number of bytes read on success, GNUNET_SYSERR on failure
+ * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
 int
 GNUNET_DISK_fn_read (const char * const fn, void *result, int len)
@@ -446,7 +446,7 @@
   fh = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ);
   if (!fh)
     return GNUNET_SYSERR;
-  ret = GNUNET_DISK_file_read (fh, result, len);
+  ret = (len == GNUNET_DISK_file_read (fh, result, len)) ? GNUNET_OK : 
GNUNET_SYSERR;
   GNUNET_assert(GNUNET_OK == GNUNET_DISK_file_close(&fh));
 
   return ret;
@@ -505,7 +505,7 @@
  * @param fn file name
  * @param buffer the data to write
  * @param n number of bytes to write
- * @return number of bytes written on success, GNUNET_SYSERR on error
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
 GNUNET_DISK_fn_write (const char * const fn, const void *buffer,
@@ -518,7 +518,7 @@
       | GNUNET_DISK_OPEN_CREATE, mode);
   if (!fh)
     return GNUNET_SYSERR;
-  ret = GNUNET_DISK_file_write (fh, buffer, n);
+  ret = (n == GNUNET_DISK_file_write (fh, buffer, n)) ? GNUNET_OK : 
GNUNET_SYSERR;
   GNUNET_assert(GNUNET_OK == GNUNET_DISK_file_close(&fh));
 
   return ret;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]