check for negative wait() return value
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 15987740f28365f8e12a53ca00de07f6e1148ec7..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;
                }
@@ -567,8 +567,8 @@ void wait_for_sessiond(struct sock_info *sock_info)
 "Please upgrade your kernel "
 "(fix is commit 9ea71503a8ed9184d2d0b8ccc4d269d05f7940ae in Linux kernel "
 "mainline). LTTng-UST will use polling mode fallback.");
+                               PERROR("futex");
                        }
-                       PERROR("futex");
                }
        }
        return;
This page took 0.023304 seconds and 4 git commands to generate.