aboutsummaryrefslogtreecommitdiff
path: root/src/util/disk.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-09 20:47:43 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-09 20:47:43 +0000
commitdca1bf1216a5d628dc35e92e772366e29caa1c91 (patch)
treefb7310031df023f77f8fc2cf7dadeea2587dc1b1 /src/util/disk.c
parentfc32a4b28542a48bbe357dd910ff10cfb2d2c722 (diff)
downloadgnunet-dca1bf1216a5d628dc35e92e772366e29caa1c91.tar.gz
gnunet-dca1bf1216a5d628dc35e92e772366e29caa1c91.zip
-check for NULL, doxygen
Diffstat (limited to 'src/util/disk.c')
-rw-r--r--src/util/disk.c12
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,
289int 289int
290GNUNET_DISK_file_size (const char *filename, 290GNUNET_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 */
1390static int 1390static int
1391remove_helper (void *unused, const char *fn) 1391remove_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 */
1406int 1405int
1407GNUNET_DISK_directory_remove (const char *filename) 1406GNUNET_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);