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
This commit is contained in:
Robert Haas 2023-04-12 11:37:13 -04:00
parent 4b1ad19a4e
commit 8e82db97b0
1 changed files with 5 additions and 0 deletions

View File

@ -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)));
}
/*