Fix: define _LGPL_SOURCE in C files
[lttng-tools.git] / src / bin / lttng / lttng.c
index bad57fd9a8a41487e33482ba5ad5e49187c4abd3..7658afc164668cbb74c1782ff290b169817ffd46 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <getopt.h>
 #include <signal.h>
 #include <stdio.h>
@@ -83,14 +84,13 @@ static struct cmd_struct commands[] =  {
        { "snapshot", cmd_snapshot},
        { "save", cmd_save},
        { "load", cmd_load},
-       { "enable-consumer", cmd_enable_consumer}, /* OBSOLETE */
-       { "disable-consumer", cmd_disable_consumer}, /* OBSOLETE */
        { NULL, NULL}   /* Array closure */
 };
 
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "LTTng Trace Control " FULL_VERSION" - " VERSION_NAME"\n\n");
+       fprintf(ofp, "LTTng Trace Control " VERSION " - " VERSION_NAME "%s\n\n",
+               GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION);
        fprintf(ofp, "usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "Options:\n");
@@ -134,8 +134,9 @@ static void usage(FILE *ofp)
 
 static void version(FILE *ofp)
 {
-       fprintf(ofp, "%s (LTTng Trace Control) " FULL_VERSION" - " VERSION_NAME"\n",
-                       progname);
+       fprintf(ofp, "%s (LTTng Trace Control) " VERSION" - " VERSION_NAME "%s\n",
+                       progname,
+                       GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION);
 }
 
 /*
@@ -442,6 +443,7 @@ static int check_args_no_sessiond(int argc, char **argv)
 static int parse_args(int argc, char **argv)
 {
        int opt, ret;
+       char *user;
 
        if (argc < 2) {
                usage(stderr);
@@ -520,6 +522,14 @@ static int parse_args(int argc, char **argv)
                goto error;
        }
 
+       /* For Mathieu Desnoyers a.k.a. Dr. Tracing */
+       user = getenv("USER");
+       if (user != NULL && ((strncmp(progname, "drtrace", 7) == 0 ||
+                                       strncmp("compudj", user, 7) == 0))) {
+               MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n", 27,1,33,27,0);
+       }
+       /* Thanks Mathieu */
+
        /* 
         * Handle leftovers which is a first level command with the trailing
         * options.
@@ -566,18 +576,9 @@ error:
 int main(int argc, char *argv[])
 {
        int ret;
-       char *user;
 
        progname = argv[0] ? argv[0] : "lttng";
 
-       /* For Mathieu Desnoyers a.k.a. Dr. Tracing */
-       user = getenv("USER");
-       if (user != NULL && ((strncmp(progname, "drtrace", 7) == 0 ||
-                               strncmp("compudj", user, 7) == 0))) {
-               MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n", 27,1,33,27,0);
-       }
-       /* Thanks Mathieu */
-
        ret = set_signal_handler();
        if (ret < 0) {
                clean_exit(ret);
This page took 0.027142 seconds and 5 git commands to generate.