From: Mathieu Desnoyers Date: Wed, 21 Dec 2011 02:35:52 +0000 (-0500) Subject: check for negative wait() return value X-Git-Tag: v1.9.3~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b7d3cb3244fc618a690efbdfa04137683396cf0d;p=lttng-ust.git check for negative wait() return value Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 5c4e4e76..c52531f5 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -413,7 +413,7 @@ int get_wait_shm(struct sock_info *sock_info, size_t mmap_size) * shared memory map will have been created. */ pid = wait(&status); - if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + if (pid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { wait_shm_fd = -1; goto end; }