X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=abc5cb9b8e1133170bb9df9fa4f93ec36676f737;hp=a7d327fbcada361477b71f44d025595adba67056;hb=81527d36f84a02110360f0332f3b35f2d3024d17;hpb=034a784813438dd99cfd1c1ea2fc9ee713dad345 diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index a7d327fbc..abc5cb9b8 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -579,14 +579,22 @@ static int spawn_sessiond(char *pathname) kill(getppid(), SIGTERM); /* wake parent */ exit(EXIT_FAILURE); } else if (pid > 0) { - int status; - /* * In daemon mode (--daemonize), sessiond only exits when * it's ready to accept commands. */ for (;;) { - waitpid(pid, &status, 0); + int status; + pid_t wait_pid_ret = waitpid(pid, &status, 0); + + if (wait_pid_ret < 0) { + if (errno == EINTR) { + continue; + } + PERROR("waitpid"); + ret = -errno; + goto end; + } if (WIFSIGNALED(status)) { ERR("Session daemon was killed by signal %d",