From: Jérémie Galarneau Date: Mon, 15 May 2017 14:37:18 +0000 (-0400) Subject: Fix: status_loc argument of waitpid() is used on error X-Git-Tag: v2.10.0-rc2~61 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=eeccf346e0898f5ad66bd1b75e12280f3f7e6dd5;p=lttng-tools.git Fix: status_loc argument of waitpid() is used on error waitpid() may leave stat_loc uninitialized on error (depending on errno's value, see WAIT(3)). Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index b856e126f..d9355b019 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -600,8 +600,7 @@ static void wait_consumer(struct consumer_data *consumer_data) ret = waitpid(consumer_data->pid, &status, 0); if (ret == -1) { PERROR("consumerd waitpid pid: %d", consumer_data->pid) - } - if (!WIFEXITED(status)) { + } else if (!WIFEXITED(status)) { ERR("consumerd termination with error: %d", WEXITSTATUS(ret)); }