aboutsummaryrefslogtreecommitdiff
path: root/contrib/basebackup_to_shell/basebackup_to_shell.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2023-04-12 11:37:13 -0400
committerRobert Haas <rhaas@postgresql.org>2023-04-12 11:51:09 -0400
commitfa83e9e23ca2542d040466d820c3bf8eef930331 (patch)
tree0c3ef67b53775e12c151e146ca2f9b113cf6d46b /contrib/basebackup_to_shell/basebackup_to_shell.c
parent749320cdc3fd747b9238d4e67a7521973c03fa27 (diff)
downloadpostgresql-fa83e9e23ca2542d040466d820c3bf8eef930331.tar.gz
postgresql-fa83e9e23ca2542d040466d820c3bf8eef930331.zip
basebackup_to_shell: Check for a NULL return from OpenPipeStream.
Per complaint from Peter Eisentraut. Discussion: http://postgr.es/m/4f1707cc-2432-da35-64a2-5c2a8d92a388@enterprisedb.com
Diffstat (limited to 'contrib/basebackup_to_shell/basebackup_to_shell.c')
-rw-r--r--contrib/basebackup_to_shell/basebackup_to_shell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/basebackup_to_shell/basebackup_to_shell.c b/contrib/basebackup_to_shell/basebackup_to_shell.c
index 2099e0f50d8..5a26bc61be9 100644
--- a/contrib/basebackup_to_shell/basebackup_to_shell.c
+++ b/contrib/basebackup_to_shell/basebackup_to_shell.c
@@ -315,6 +315,11 @@ shell_run_command(bbsink_shell *sink, const char *filename)
/* Run it. */
sink->pipe = OpenPipeStream(sink->current_command, PG_BINARY_W);
+ if (sink->pipe == NULL)
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not execute command \"%s\": %m",
+ sink->current_command)));
}
/*