From fd231ae62b75ad3b4c15e4495839e82c1bf15723 Mon Sep 17 00:00:00 2001 From: Mateusz Moscicki Date: Tue, 17 Jul 2018 13:57:41 +0200 Subject: [PATCH] Log message to dlog when wait_for_child returns non-zero value Change-Id: Ib2b3df0939a13a553b05cc747e5b17a4e5fe580d --- src/shared/util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/util.c b/src/shared/util.c index 8d8bcc4..21b76d3 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -480,7 +480,11 @@ int run_command_write_fd_timeout(char *path, char *args[], char *env[], int dfd, // let's wait a second for a child int exit_code = -1; - if (wait_for_child(pid, &exit_code, 1) == 0 && exit_code != 0) + int wait_res = wait_for_child(pid, &exit_code, 1); + + if (wait_res != 0) + _I("wait_for_child for \%s\" returns non-zero value\n", path); + else if (exit_code != 0) _I("\"%s\" exit code: %d\n", path, exit_code); return (eof == 1 && exit_code == 0) ? count : -abs(exit_code); -- 2.7.4