Fix: lttng-ust-comm: wait on wrong child process
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 7b353c8553a0352a85ab4a95c2944752a691cbae..716795e0e818028d1a6fc6fa63374abaaf0ebafa 100644 (file)
@@ -1293,14 +1293,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.02366 seconds and 4 git commands to generate.