check for negative wait() return value
[lttng-ust.git] / 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.025002 seconds and 4 git commands to generate.