mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user