diff options
-rw-r--r-- | src/bin/pg_archivecleanup/pg_archivecleanup.c | 11 | ||||
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 6 | ||||
-rw-r--r-- | src/bin/pg_basebackup/pg_recvlogical.c | 3 | ||||
-rw-r--r-- | src/bin/pgbench/pgbench.c | 3 |
4 files changed, 22 insertions, 1 deletions
diff --git a/src/bin/pg_archivecleanup/pg_archivecleanup.c b/src/bin/pg_archivecleanup/pg_archivecleanup.c index 12338e3bb2c..6c3e7f4e010 100644 --- a/src/bin/pg_archivecleanup/pg_archivecleanup.c +++ b/src/bin/pg_archivecleanup/pg_archivecleanup.c @@ -151,21 +151,30 @@ CleanupPriorWALFiles(void) { pg_log_error("could not remove file \"%s\": %m", WALFilePath); - break; + exit(1); } } } if (errno) + { pg_log_error("could not read archive location \"%s\": %m", archiveLocation); + exit(1); + } if (closedir(xldir)) + { pg_log_error("could not close archive location \"%s\": %m", archiveLocation); + exit(1); + } } else + { pg_log_error("could not open archive location \"%s\": %m", archiveLocation); + exit(1); + } } /* diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 8f69c573804..7296eb97d01 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1626,8 +1626,11 @@ ReceiveTarAndUnpackCopyChunk(size_t r, char *copybuf, void *callback_data) } #ifndef WIN32 if (chmod(state->filename, (mode_t) filemode)) + { pg_log_error("could not set permissions on directory \"%s\": %m", state->filename); + exit(1); + } #endif } else if (copybuf[156] == '2') @@ -1676,8 +1679,11 @@ ReceiveTarAndUnpackCopyChunk(size_t r, char *copybuf, void *callback_data) #ifndef WIN32 if (chmod(state->filename, (mode_t) filemode)) + { pg_log_error("could not set permissions on file \"%s\": %m", state->filename); + exit(1); + } #endif if (state->current_len_left == 0) diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c index 1d59bf37440..ebeb12d497c 100644 --- a/src/bin/pg_basebackup/pg_recvlogical.c +++ b/src/bin/pg_basebackup/pg_recvlogical.c @@ -341,7 +341,10 @@ StreamLogicalLog(void) } if (fstat(outfd, &statbuf) != 0) + { pg_log_error("could not stat file \"%s\": %m", outfile); + goto error; + } output_isfile = S_ISREG(statbuf.st_mode) && !isatty(outfd); } diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index c51ebb8e31d..55d14604c02 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -6469,7 +6469,10 @@ main(int argc, char **argv) errno = THREAD_BARRIER_INIT(&barrier, nthreads); if (errno != 0) + { pg_log_fatal("could not initialize barrier: %m"); + exit(1); + } #ifdef ENABLE_THREAD_SAFETY /* start all threads but thread 0 which is executed directly later */ |