diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-07-25 08:41:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-07-25 08:41:56 +0000 |
commit | 00c4cd3fbb54ef5860c3fa4c13d5318391d61a6e (patch) | |
tree | 4e01c20bcc2e129ecbc7295755685ea264c9e26d /src | |
parent | 130185df47d89b3df36c8371fe18eccd76fca7fc (diff) | |
download | gnunet-00c4cd3fbb54ef5860c3fa4c13d5318391d61a6e.tar.gz gnunet-00c4cd3fbb54ef5860c3fa4c13d5318391d61a6e.zip |
-nocaps
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_disk_lib.h | 2 | ||||
-rw-r--r-- | src/util/disk.c | 20 |
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 | */ |
685 | int | 685 | int |
686 | GNUNET_DISK_directory_remove (const char *fileName); | 686 | GNUNET_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 | */ |
1358 | int | 1358 | int |
1359 | GNUNET_DISK_directory_remove (const char *fileName) | 1359 | GNUNET_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; |