#include "utils.h"
+#include <common/error.hpp>
+
#include <lttng/action/list-internal.hpp>
#include <lttng/condition/event-rule-matches.h>
#include <lttng/lttng.h>
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;
}
return names_match;
}
-int main(int argc, char **argv)
+static int _main(int argc, char **argv)
{
int ret;
int option;
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: %s", e.what());
+ abort();
+ }
+}