aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pgbench/pgbench.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-07-29 11:42:58 +0900
committerMichael Paquier <michael@paquier.xyz>2021-07-29 11:42:58 +0900
commit856de3b39cf6041338b286a99257c324ce647f4e (patch)
tree4b9f5fedbbeb125095b13df630c6479ed4b89eb0 /src/bin/pgbench/pgbench.c
parent2ad98fdf53edf1a90123e3b189cc6f0a31986891 (diff)
downloadpostgresql-856de3b39cf6041338b286a99257c324ce647f4e.tar.gz
postgresql-856de3b39cf6041338b286a99257c324ce647f4e.zip
Add some missing exit() calls in error paths for various binaries
The following changes are done: - In pg_archivecleanup, the cleanup of older WAL segments would never fail immediately. - In pgbench, the initialization of a thread barrier would not fail hard. - In pg_recvlogical, a stat() failure never got the call. - In pg_basebackup, two chmod() reported a failure without exit()'ing when unpacking some tar data freshly received. It may be possible to continue writing some data even after this failure, but that could be confusing to the user at the end. These are arguably bugs, but they would happen for code paths where a failure is unlikely going to happen, so no backpatch is done. Reviewed-by: Robert Haas, Fabien Coelho Discussion: https://postgr.es/m/YQDMdB+B68yePFeT@paquier.xyz
Diffstat (limited to 'src/bin/pgbench/pgbench.c')
-rw-r--r--src/bin/pgbench/pgbench.c3
1 files changed, 3 insertions, 0 deletions
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 */