From d02363609a73a62a2c5cfd06f02a7e8babe1bc75 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 6 Dec 2006 16:56:19 +0000 Subject: [PATCH] If the pre-xfer exec failed with -1, output the strerror() from the waitpid() call. --- clientserver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clientserver.c b/clientserver.c index 97f4fe11..b7771251 100644 --- a/clientserver.c +++ b/clientserver.c @@ -244,7 +244,9 @@ static char *finish_pre_exec(pid_t pid, int fd, char *request, if (wait_process(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { char *e; - if (asprintf(&e, "pre-xfer exec returned failure (%d)\n", status) < 0) + if (asprintf(&e, "pre-xfer exec returned failure (%d)%s%s\n", + status, status < 0 ? ": " : "", + status < 0 ? strerror(errno) : "") < 0) out_of_memory("finish_pre_exec"); return e; } -- 2.34.1