mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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 5c7038d70b
.
Reported-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/baa34329-f431-46af-bf74-1a78fdc90e4f@eisentraut.org
This commit is contained in:
@ -393,8 +393,8 @@ pipe_read_line(char *cmd)
|
|||||||
log_error(errcode_for_file_access(),
|
log_error(errcode_for_file_access(),
|
||||||
_("could not read from command \"%s\": %m"), cmd);
|
_("could not read from command \"%s\": %m"), cmd);
|
||||||
else
|
else
|
||||||
log_error(errcode_for_file_access(),
|
log_error(errcode(ERRCODE_NO_DATA),
|
||||||
_("no data was returned by command \"%s\": %m"), cmd);
|
_("no data was returned by command \"%s\""), cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) pclose_check(pipe_cmd);
|
(void) pclose_check(pipe_cmd);
|
||||||
|
Reference in New Issue
Block a user