aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_disk_lib.h2
-rw-r--r--src/util/disk.c20
2 files changed, 11 insertions, 11 deletions
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h
index 51f585655..9e25cd95a 100644
--- a/src/include/gnunet_disk_lib.h
+++ b/src/include/gnunet_disk_lib.h
@@ -683,7 +683,7 @@ GNUNET_DISK_directory_test (const char *fil);
683 * @return GNUNET_OK on success, GNUNET_SYSERR on error 683 * @return GNUNET_OK on success, GNUNET_SYSERR on error
684 */ 684 */
685int 685int
686GNUNET_DISK_directory_remove (const char *fileName); 686GNUNET_DISK_directory_remove (const char *filename);
687 687
688 688
689/** 689/**
diff --git a/src/util/disk.c b/src/util/disk.c
index b4674c99b..5d37372ea 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1352,34 +1352,34 @@ remove_helper (void *unused, const char *fn)
1352 * caution. 1352 * caution.
1353 * 1353 *
1354 * 1354 *
1355 * @param fileName the file to remove 1355 * @param filename the file to remove
1356 * @return GNUNET_OK on success, GNUNET_SYSERR on error 1356 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1357 */ 1357 */
1358int 1358int
1359GNUNET_DISK_directory_remove (const char *fileName) 1359GNUNET_DISK_directory_remove (const char *filename)
1360{ 1360{
1361 struct stat istat; 1361 struct stat istat;
1362 1362
1363 if (0 != LSTAT (fileName, &istat)) 1363 if (0 != LSTAT (filename, &istat))
1364 return GNUNET_NO; /* file may not exist... */ 1364 return GNUNET_NO; /* file may not exist... */
1365 CHMOD (fileName, S_IWUSR | S_IRUSR | S_IXUSR); 1365 (void) CHMOD (filename, S_IWUSR | S_IRUSR | S_IXUSR);
1366 if (UNLINK (fileName) == 0) 1366 if (UNLINK (filename) == 0)
1367 return GNUNET_OK; 1367 return GNUNET_OK;
1368 if ((errno != EISDIR) && 1368 if ((errno != EISDIR) &&
1369 /* EISDIR is not sufficient in all cases, e.g. 1369 /* EISDIR is not sufficient in all cases, e.g.
1370 * sticky /tmp directory may result in EPERM on BSD. 1370 * sticky /tmp directory may result in EPERM on BSD.
1371 * So we also explicitly check "isDirectory" */ 1371 * So we also explicitly check "isDirectory" */
1372 (GNUNET_YES != GNUNET_DISK_directory_test (fileName))) 1372 (GNUNET_YES != GNUNET_DISK_directory_test (filename)))
1373 { 1373 {
1374 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "rmdir", fileName); 1374 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "rmdir", filename);
1375 return GNUNET_SYSERR; 1375 return GNUNET_SYSERR;
1376 } 1376 }
1377 if (GNUNET_SYSERR == 1377 if (GNUNET_SYSERR ==
1378 GNUNET_DISK_directory_scan (fileName, &remove_helper, NULL)) 1378 GNUNET_DISK_directory_scan (filename, &remove_helper, NULL))
1379 return GNUNET_SYSERR; 1379 return GNUNET_SYSERR;
1380 if (0 != RMDIR (fileName)) 1380 if (0 != RMDIR (filename))
1381 { 1381 {
1382 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "rmdir", fileName); 1382 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "rmdir", filename);
1383 return GNUNET_SYSERR; 1383 return GNUNET_SYSERR;
1384 } 1384 }
1385 return GNUNET_OK; 1385 return GNUNET_OK;