From b7d3cb3244fc618a690efbdfa04137683396cf0d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 20 Dec 2011 21:35:52 -0500 Subject: [PATCH] check for negative wait() return value Signed-off-by: Mathieu Desnoyers --- liblttng-ust/lttng-ust-comm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.34.1