Fix: erroneous specifier used with ERR_FMT macro
[lttng-tools.git] / src / bin / lttng-sessiond / main.cpp
index 312c243cf1a21cbd899285242e55fa636f73651a..bfd53e7e47041818996b55d9bb15266901688ebf 100644 (file)
@@ -52,6 +52,7 @@
 #include <common/futex.hpp>
 #include <common/ini-config/ini-config.hpp>
 #include <common/kernel-consumer/kernel-consumer.hpp>
+#include <common/lockfile.hpp>
 #include <common/logging-utils.hpp>
 #include <common/path.hpp>
 #include <common/relayd/relayd.hpp>
@@ -1403,7 +1404,7 @@ static void sessiond_uuid_log()
 /*
  * main
  */
-int main(int argc, char **argv)
+static int _main(int argc, char **argv)
 {
        int ret = 0, retval = 0;
        const char *env_app_timeout;
@@ -1770,9 +1771,8 @@ int main(int argc, char **argv)
        }
 
        try {
-               the_rotation_thread_handle =
-                       lttng::make_unique<lttng::sessiond::rotation_thread>(
-                               *rotation_timer_queue, *the_notification_thread_handle);
+               the_rotation_thread_handle = lttng::make_unique<lttng::sessiond::rotation_thread>(
+                       *rotation_timer_queue, *the_notification_thread_handle);
        } catch (const std::exception& e) {
                retval = -1;
                ERR("Failed to create rotation thread: %s", e.what());
@@ -1976,3 +1976,13 @@ exit_set_signal_handler:
                exit(EXIT_FAILURE);
        }
 }
+
+int main(int argc, char **argv)
+{
+       try {
+               return _main(argc, argv);
+       } catch (const std::exception& e) {
+               ERR_FMT("Unhandled exception caught by main thread: {}", e.what());
+               abort();
+       }
+}
This page took 0.036449 seconds and 4 git commands to generate.