If the pre-xfer exec failed with -1, output the strerror()

from the waitpid() call.
This commit is contained in:
Wayne Davison committed 2006-12-06 16:56:19 +00:00
1 parent 1e1ca25343
commit d02363609a
1 file changed
+3 -1
+3 -1
View File
@@ -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;
}