sessiond: add support for anonymous triggers
[lttng-tools.git] / src / common / trigger.c
index a86295069a85c12d1b17ee8bbaa3ade4643fa29c..5c48609ea5f12659c11b2eb50e01d28f5225b34f 100644 (file)
@@ -346,7 +346,12 @@ LTTNG_HIDDEN
 bool lttng_trigger_is_equal(
                const struct lttng_trigger *a, const struct lttng_trigger *b)
 {
-       if (strcmp(a->name, b->name) != 0) {
+       if (!!a->name != !!b->name) {
+               /* Both must be either anonymous or named. */
+               return false;
+       }
+
+       if (a->name && strcmp(a->name, b->name) != 0) {
                return false;
        }
 
This page took 0.022852 seconds and 4 git commands to generate.