Fix: erroneous specifier used with ERR_FMT macro
[lttng-tools.git] / tests / regression / tools / trigger / utils / notification-client.cpp
index 02dc0626087aa6ff77ac065b8de482b03674a1f8..27bd100c694fbd567e8a5b6e055b317f583b3c53 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "utils.h"
 
+#include <common/error.hpp>
+
 #include <lttng/action/list-internal.hpp>
 #include <lttng/condition/event-rule-matches.h>
 #include <lttng/lttng.h>
@@ -38,13 +40,12 @@ static struct option long_options[] = {
 
 static bool action_list_contains_notify(const struct lttng_action *action_list)
 {
-       const struct lttng_action *sub_action;
-
-       for_each_action_const (sub_action, action_list) {
+       for (auto sub_action : lttng::ctl::const_action_list_view(action_list)) {
                if (lttng_action_get_type(sub_action) == LTTNG_ACTION_TYPE_NOTIFY) {
                        return true;
                }
        }
+
        return false;
 }
 
@@ -82,7 +83,7 @@ end:
        return names_match;
 }
 
-int main(int argc, char **argv)
+static int _main(int argc, char **argv)
 {
        int ret;
        int option;
@@ -280,3 +281,13 @@ end:
        free(expected_trigger_name);
        return !!ret;
 }
+
+int main(int argc, char **argv)
+{
+       try {
+               return _main(argc, argv);
+       } catch (const std::exception& e) {
+               ERR_FMT("Unhandled exception caught by notification client: {}", e.what());
+               abort();
+       }
+}
This page took 0.024565 seconds and 4 git commands to generate.