Use compiler-agnostic defines to silence warning
[lttng-tools.git] / src / bin / lttng / commands / destroy.cpp
index 5e19d4189025181682d2040d503290cc9d0172cf..b39d705276b992329759df938d550037d830b4fe 100644 (file)
@@ -7,6 +7,7 @@
 
 #define _LGPL_SOURCE
 #include "../command.hpp"
 
 #define _LGPL_SOURCE
 #include "../command.hpp"
+#include "../exception.hpp"
 
 #include <common/exception.hpp>
 #include <common/make-unique-wrapper.hpp>
 
 #include <common/exception.hpp>
 #include <common/make-unique-wrapper.hpp>
@@ -272,6 +273,14 @@ cmd_error_code destroy_sessions(const lttng::cli::session_spec& spec)
                                lttng_strerror(-ctl_exception.code()));
                        listing_failed = true;
                        return {};
                                lttng_strerror(-ctl_exception.code()));
                        listing_failed = true;
                        return {};
+               } catch (const lttng::cli::no_default_session_error& cli_exception) {
+                       /*
+                        * The retrieval of the default session name already logs
+                        * an error when it fails. There is no value in printing
+                        * anything about this exception.
+                        */
+                       listing_failed = true;
+                       return {};
                }
        }();
 
                }
        }();
 
@@ -340,7 +349,7 @@ int cmd_destroy(int argc, const char **argv)
        static poptContext pc;
        const char *leftover = nullptr;
        lttng::cli::session_spec spec(lttng::cli::session_spec::type::NAME);
        static poptContext pc;
        const char *leftover = nullptr;
        lttng::cli::session_spec spec(lttng::cli::session_spec::type::NAME);
-       lttng::cli::session_list const sessions;
+       const lttng::cli::session_list sessions;
 
        pc = poptGetContext(nullptr, argc, argv, long_options, 0);
        poptReadDefaultConfig(pc, 0);
 
        pc = poptGetContext(nullptr, argc, argv, long_options, 0);
        poptReadDefaultConfig(pc, 0);
This page took 0.026851 seconds and 4 git commands to generate.