diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-09 20:47:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-09 20:47:43 +0000 |
commit | dca1bf1216a5d628dc35e92e772366e29caa1c91 (patch) | |
tree | fb7310031df023f77f8fc2cf7dadeea2587dc1b1 /src/util/disk.c | |
parent | fc32a4b28542a48bbe357dd910ff10cfb2d2c722 (diff) | |
download | gnunet-dca1bf1216a5d628dc35e92e772366e29caa1c91.tar.gz gnunet-dca1bf1216a5d628dc35e92e772366e29caa1c91.zip |
-check for NULL, doxygen
Diffstat (limited to 'src/util/disk.c')
-rw-r--r-- | src/util/disk.c | 12 |
1 files changed, 8 insertions, 4 deletions
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, | |||
289 | int | 289 | int |
290 | GNUNET_DISK_file_size (const char *filename, | 290 | GNUNET_DISK_file_size (const char *filename, |
291 | uint64_t * size, | 291 | uint64_t * size, |
292 | int include_symbolic_links, | 292 | int include_symbolic_links, |
293 | int single_file_mode) | 293 | int single_file_mode) |
294 | { | 294 | { |
295 | struct GetFileSizeData gfsd; | 295 | struct GetFileSizeData gfsd; |
@@ -1385,7 +1385,7 @@ GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, | |||
1385 | * | 1385 | * |
1386 | * @param unused not used | 1386 | * @param unused not used |
1387 | * @param fn directory to remove | 1387 | * @param fn directory to remove |
1388 | * @return GNUNET_OK | 1388 | * @return #GNUNET_OK |
1389 | */ | 1389 | */ |
1390 | static int | 1390 | static int |
1391 | remove_helper (void *unused, const char *fn) | 1391 | remove_helper (void *unused, const char *fn) |
@@ -1399,15 +1399,19 @@ remove_helper (void *unused, const char *fn) | |||
1399 | * Remove all files in a directory (rm -rf). Call with | 1399 | * Remove all files in a directory (rm -rf). Call with |
1400 | * caution. | 1400 | * caution. |
1401 | * | 1401 | * |
1402 | * | ||
1403 | * @param filename the file to remove | 1402 | * @param filename the file to remove |
1404 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1403 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
1405 | */ | 1404 | */ |
1406 | int | 1405 | int |
1407 | GNUNET_DISK_directory_remove (const char *filename) | 1406 | GNUNET_DISK_directory_remove (const char *filename) |
1408 | { | 1407 | { |
1409 | struct stat istat; | 1408 | struct stat istat; |
1410 | 1409 | ||
1410 | if (NULL == filename) | ||
1411 | { | ||
1412 | GNUNET_break (0); | ||
1413 | return GNUNET_SYSERR; | ||
1414 | } | ||
1411 | if (0 != LSTAT (filename, &istat)) | 1415 | if (0 != LSTAT (filename, &istat)) |
1412 | return GNUNET_NO; /* file may not exist... */ | 1416 | return GNUNET_NO; /* file may not exist... */ |
1413 | (void) CHMOD (filename, S_IWUSR | S_IRUSR | S_IXUSR); | 1417 | (void) CHMOD (filename, S_IWUSR | S_IRUSR | S_IXUSR); |