Skip to content

Commit be41a9b

Browse files
Fix errorhandling for reading from a pipe
When reading a line from a pipe failed on no data being read, the errorhandling was erroneously logging with %m even thoug no error description is available for %m to print. This flaw accidentally introduced in 5c7038d. Reported-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/baa34329-f431-46af-bf74-1a78fdc90e4f@eisentraut.org
1 parent 6929e13 commit be41a9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/exec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ pipe_read_line(char *cmd)
393393
log_error(errcode_for_file_access(),
394394
_("could not read from command \"%s\": %m"), cmd);
395395
else
396-
log_error(errcode_for_file_access(),
397-
_("no data was returned by command \"%s\": %m"), cmd);
396+
log_error(errcode(ERRCODE_NO_DATA),
397+
_("no data was returned by command \"%s\""), cmd);
398398
}
399399

400400
(void) pclose_check(pipe_cmd);

0 commit comments

Comments
 (0)