Fix: define _LGPL_SOURCE in C files
[lttng-tools.git] / src / bin / lttng / commands / snapshot.c
index ebe1d14aa2e384d04a91bf1cd218c3055e14f043..4b38edf623d157ffad7a6d11a6a01bb802995832 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <assert.h>
 #include <inttypes.h>
 #include <popt.h>
@@ -294,7 +295,6 @@ static int mi_del_output(uint32_t id, const char *name)
 
        ret = lttng_snapshot_del_output(current_session_name, output);
        if (ret < 0) {
-               ret = CMD_FATAL;
                goto error;
        }
 
@@ -377,7 +377,6 @@ static int mi_add_output(const char *url)
        /* This call, if successful, populates the id of the output object. */
        ret = lttng_snapshot_add_output(current_session_name, output);
        if (ret < 0) {
-               ret = CMD_ERROR;
                goto error;
        }
 
@@ -672,10 +671,10 @@ static int handle_command(const char **argv)
                cmd = &actions[i];
        }
 
-       ret = -CMD_UNDEFINED;
+       ret = CMD_UNDEFINED;
 
 end:
-       /* Overwrite ret if an error occured in cmd->func() */
+       /* Overwrite ret if an error occurred in cmd->func() */
        ret = command_ret ? command_ret : ret;
        return ret;
 }
@@ -761,7 +760,7 @@ int cmd_snapshot(int argc, const char **argv)
        }
 
        command_ret = handle_command(poptGetArgs(pc));
-       if (command_ret < 0) {
+       if (command_ret) {
                switch (-command_ret) {
                case LTTNG_ERR_EPERM:
                        ERR("The session needs to be set in no output mode (--no-output)");
This page took 0.025792 seconds and 5 git commands to generate.