X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=5027fce90dc1d8aca19f63566a7a6e4535b52489;hb=8490897a08bcb2e38d78ccae01fe00e50f2f8bd8;hp=19c560272bf3c35740adce8e05c5ddcf86c3a6f0;hpb=0f4fa0d2b30909ff5b0ec872e2babc4cff6f786e;p=lttng-tools.git diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 19c560272..5027fce90 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -81,7 +80,7 @@ static struct poptOption long_options[] = { * why this declaration exists and used ONLY in for this command. */ extern int _lttng_create_session_ext(const char *name, const char *url, - const char *datetime, int live_timer); + const char *datetime); /* * usage @@ -460,7 +459,7 @@ static int create_session(void) } ret = lttng_create_session_live(session_name, url, opt_live_timer); } else { - ret = _lttng_create_session_ext(session_name, url, datetime, -1); + ret = _lttng_create_session_ext(session_name, url, datetime); } if (ret < 0) { /* Don't set ret so lttng can interpret the sessiond error. */ @@ -579,14 +578,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",