* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
#include <ctype.h>
* 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
}
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. */
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",
}
ret = spawn_sessiond(pathname);
- if (ret < 0) {
- ERR("Problem occurred when starting %s", pathname);
- }
end:
+ if (ret) {
+ ERR("Problem occurred while launching session daemon (%s)",
+ pathname);
+ }
return ret;
}
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_HELP:
- usage(stdout);
+ SHOW_HELP();
goto end;
case OPT_LIST_OPTIONS:
list_cmd_options(stdout, long_options);