gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r19069 - in gnunet/src: include util
Date: Mon, 9 Jan 2012 17:38:26 +0100

Author: grothoff
Date: 2012-01-09 17:38:26 +0100 (Mon, 09 Jan 2012)
New Revision: 19069

Modified:
   gnunet/src/include/gnunet_disk_lib.h
   gnunet/src/util/disk.c
Log:
LRN: make disk iterator start return GNUNET_SYSERR if run on empty directory

Modified: gnunet/src/include/gnunet_disk_lib.h
===================================================================
--- gnunet/src/include/gnunet_disk_lib.h        2012-01-09 13:11:46 UTC (rev 
19068)
+++ gnunet/src/include/gnunet_disk_lib.h        2012-01-09 16:38:26 UTC (rev 
19069)
@@ -565,8 +565,10 @@
  * @param dirName the name of the directory
  * @param callback the method to call for each file
  * @param callback_cls closure for callback
+ * @return GNUNET_YES if directory is not empty and @callback
+ *         will be called later, GNUNET_NO otherwise, GNUNET_SYSERR on error.
  */
-void
+int
 GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio,
                                       const char *dirName,
                                       GNUNET_DISK_DirectoryIteratorCallback

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2012-01-09 13:11:46 UTC (rev 19068)
+++ gnunet/src/util/disk.c      2012-01-09 16:38:26 UTC (rev 19069)
@@ -1047,8 +1047,10 @@
  * @param dirName the name of the directory
  * @param callback the method to call for each file
  * @param callback_cls closure for callback
+ * @return GNUNET_YES if directory is not empty and @callback
+ *         will be called later, GNUNET_NO otherwise, GNUNET_SYSERR on error.
  */
-void
+int
 GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio,
                                       const char *dirName,
                                       GNUNET_DISK_DirectoryIteratorCallback
@@ -1064,11 +1066,11 @@
   {
     GNUNET_free (di);
     callback (callback_cls, NULL, NULL, NULL);
-    return;
+    return GNUNET_SYSERR;
   }
   di->dirname = GNUNET_strdup (dirName);
   di->priority = prio;
-  GNUNET_DISK_directory_iterator_next (di, GNUNET_NO);
+  return GNUNET_DISK_directory_iterator_next (di, GNUNET_NO);
 }
 
 




reply via email to

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