diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2021-11-23 20:01:17 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2021-11-23 20:01:17 +0000 |
commit | 2ba76be6f9d89d993092bad22a788fedf816ce77 (patch) | |
tree | f27f87b9eb128447660e337ca324adabdf04a300 /src | |
parent | 05b70ebcdceb3d0b2eadd39b84782d22b63ed9a2 (diff) |
Error-check scan dir tidying
Diffstat (limited to 'src')
-rw-r--r-- | src/src/spool_mbox.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/src/spool_mbox.c b/src/src/spool_mbox.c index e5b9ad79c..8b2aae394 100644 --- a/src/src/spool_mbox.c +++ b/src/src/spool_mbox.c @@ -219,7 +219,7 @@ if (spool_mbox_ok && !f.no_mbox_unspool) { debug_printf("Unable to opendir(%s): %s\n", mbox_path, strerror(errno)); /* Just in case we still can: */ - rmdir(CS mbox_path); + (void) rmdir(CS mbox_path); return; } /* loop thru dir & delete entries */ @@ -230,13 +230,15 @@ if (spool_mbox_ok && !f.no_mbox_unspool) file_path = string_sprintf("%s/%s", mbox_path, name); debug_printf("unspool_mbox(): unlinking '%s'\n", file_path); - (void) unlink(CS file_path); + if (unlink(CS file_path) != 0) + log_write(0, LOG_MAIN|LOG_PANIC, "unlink(%s): %s", file_path, strerror(errno)); } closedir(tempdir); /* remove directory */ - rmdir(CS mbox_path); + if (rmdir(CS mbox_path) != 0) + log_write(0, LOG_MAIN|LOG_PANIC, "rmdir(%s): %s", mbox_path, strerror(errno)); store_reset(reset_point); } spool_mbox_ok = 0; |