summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson2024-03-08 21:53:06 +0000
committerDaniel Gustafsson2024-03-08 21:53:06 +0000
commitbe41a9b0380778a07386208afbf3f41ba7286cf3 (patch)
treec1a138b8147fa2c45c7bf855b6eecda1be825314
parent6929e133b309d5d4568b5ed25b136935f63be618 (diff)
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 5c7038d70bb. Reported-by: Peter Eisentraut <[email protected]> Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/common/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/exec.c b/src/common/exec.c
index bcd5b71101e..0bee19c1e53 100644
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -393,8 +393,8 @@ pipe_read_line(char *cmd)
log_error(errcode_for_file_access(),
_("could not read from command \"%s\": %m"), cmd);
else
- log_error(errcode_for_file_access(),
- _("no data was returned by command \"%s\": %m"), cmd);
+ log_error(errcode(ERRCODE_NO_DATA),
+ _("no data was returned by command \"%s\""), cmd);
}
(void) pclose_check(pipe_cmd);