summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2023-04-12 15:37:13 +0000
committerRobert Haas2023-04-12 15:37:13 +0000
commit8e82db97b0a474008d8212a63f34e449a8c50bcd (patch)
tree37b14a23d0a4579c2a6a80b7a901460d41c1546c
parent4b1ad19a4e221897d01fbfe68b89412c8c5a9cbb (diff)
basebackup_to_shell: Check for a NULL return from OpenPipeStream.
Per complaint from Peter Eisentraut. Discussion: http://postgr.es/m/[email protected]
-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 29f5069d42..57ed587d48 100644
--- a/contrib/basebackup_to_shell/basebackup_to_shell.c
+++ b/contrib/basebackup_to_shell/basebackup_to_shell.c
@@ -263,6 +263,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)));
}
/*