Skip to content

Commit fa83e9e

Browse files
committed
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
1 parent 749320c commit fa83e9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

contrib/basebackup_to_shell/basebackup_to_shell.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ shell_run_command(bbsink_shell *sink, const char *filename)
315315

316316
/* Run it. */
317317
sink->pipe = OpenPipeStream(sink->current_command, PG_BINARY_W);
318+
if (sink->pipe == NULL)
319+
ereport(ERROR,
320+
(errcode_for_file_access(),
321+
errmsg("could not execute command \"%s\": %m",
322+
sink->current_command)));
318323
}
319324

320325
/*

0 commit comments

Comments
 (0)