Fix: status_loc argument of waitpid() is used on error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 15 May 2017 14:37:18 +0000 (10:37 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 15 May 2017 20:30:36 +0000 (16:30 -0400)
waitpid() may leave stat_loc uninitialized on error (depending
on errno's value, see WAIT(3)).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index 172f8c270d5b633466ace52d70fdcf3f3f061318..0df0b1f2e04bc4601149088740b6feec2b0bfdb2 100644 (file)
@@ -564,8 +564,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));
        }
This page took 0.053133 seconds and 4 git commands to generate.