Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8e82db9

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 4b1ad19 commit 8e82db9

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
@@ -263,6 +263,11 @@ shell_run_command(bbsink_shell *sink, const char *filename)
263263

264264
/* Run it. */
265265
sink->pipe = OpenPipeStream(sink->current_command, PG_BINARY_W);
266+
if (sink->pipe == NULL)
267+
ereport(ERROR,
268+
(errcode_for_file_access(),
269+
errmsg("could not execute command \"%s\": %m",
270+
sink->current_command)));
266271
}
267272

268273
/*

0 commit comments

Comments
 (0)