check for negative wait() return value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 21 Dec 2011 02:35:52 +0000 (21:35 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 21 Dec 2011 02:35:52 +0000 (21:35 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c

index 5c4e4e76609b9d637ace3622505c27304f19d618..c52531f53bac8626c065958458b84c7cae2725ea 100644 (file)
@@ -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;
                }
This page took 0.02615 seconds and 4 git commands to generate.