Coverity warning: sessiond: uncaught exception in main
[lttng-tools.git] / src / bin / lttng-sessiond / main.cpp
index 312c243cf1a21cbd899285242e55fa636f73651a..7f0995a9b0e8388bad9ed4617404825fcf5a06e0 100644 (file)
@@ -1403,7 +1403,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 +1770,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 +1975,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: %s", e.what());
+               abort();
+       }
+}
This page took 0.025768 seconds and 4 git commands to generate.