Fix: lttng-ust-comm: wait on wrong child process
[lttng-ust.git] / src / lib / lttng-ust / lttng-ust-comm.c
index a46ca4e40bb4b79bf0002fc1a2f7ea0cd35e9627..a07e1e12483bf051e68d973883fc439e9b611c44 100644 (file)
@@ -1582,14 +1582,14 @@ open_write:
        pid = fork();
        URCU_TLS(lttng_ust_nest_count)--;
        if (pid > 0) {
-               int status;
+               int status, wait_ret;
 
                /*
                 * Parent: wait for child to return, in which case the
                 * shared memory map will have been created.
                 */
-               pid = wait(&status);
-               if (pid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+               wait_ret = waitpid(pid, &status, 0);
+               if (wait_ret < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
                        wait_shm_fd = -1;
                        goto end;
                }
This page took 0.024758 seconds and 5 git commands to generate.