lttng: show man page when using command's --help
[lttng-tools.git] / src / bin / lttng / commands / create.c
index a7d327fbcada361477b71f44d025595adba67056..efc9e60c1609c189daae7ca09f3b765568c27b4c 100644 (file)
@@ -15,7 +15,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <assert.h>
 #include <ctype.h>
@@ -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",
@@ -692,7 +699,7 @@ int cmd_create(int argc, const char **argv)
        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);
This page took 0.023647 seconds and 4 git commands to generate.