From dca1bf1216a5d628dc35e92e772366e29caa1c91 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 9 Nov 2013 20:47:43 +0000 Subject: -check for NULL, doxygen --- src/util/disk.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/util/disk.c') diff --git a/src/util/disk.c b/src/util/disk.c index d0065734d..e3743430e 100644 --- a/src/util/disk.c +++ b/src/util/disk.c @@ -289,7 +289,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, off_t offset, int GNUNET_DISK_file_size (const char *filename, uint64_t * size, - int include_symbolic_links, + int include_symbolic_links, int single_file_mode) { struct GetFileSizeData gfsd; @@ -1385,7 +1385,7 @@ GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, * * @param unused not used * @param fn directory to remove - * @return GNUNET_OK + * @return #GNUNET_OK */ static int remove_helper (void *unused, const char *fn) @@ -1399,15 +1399,19 @@ remove_helper (void *unused, const char *fn) * Remove all files in a directory (rm -rf). Call with * caution. * - * * @param filename the file to remove - * @return GNUNET_OK on success, GNUNET_SYSERR on error + * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ int GNUNET_DISK_directory_remove (const char *filename) { struct stat istat; + if (NULL == filename) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } if (0 != LSTAT (filename, &istat)) return GNUNET_NO; /* file may not exist... */ (void) CHMOD (filename, S_IWUSR | S_IRUSR | S_IXUSR); -- cgit v1.2.3