Fix: Buggy string comparison in ust registry ht_match_event
[lttng-tools.git] / src / bin / lttng-sessiond / ust-registry.c
index 2ba41ed45dffbb91d272c4561dcf040290f6ed58..3f1390dc3df1e65449700c12fa502215a9e29426 100644 (file)
@@ -43,13 +43,13 @@ static int ht_match_event(struct cds_lfht_node *node, const void *_key)
        key = _key;
 
        /* It has to be a perfect match. */
-       if (strncmp(event->name, key->name, sizeof(event->name)) != 0) {
+       if (strncmp(event->name, key->name, sizeof(event->name))) {
                goto no_match;
        }
 
        /* It has to be a perfect match. */
        if (strncmp(event->signature, key->signature,
-                               strlen(event->signature) != 0)) {
+                       strlen(event->signature))) {
                goto no_match;
        }
 
@@ -593,7 +593,6 @@ int ust_registry_session_init(struct ust_registry_session **sessionp,
                        S_IRWXU | S_IRWXG,
                        euid, egid);
                if (ret) {
-                       errno = -ret;
                        PERROR("run_as_mkdir_recursive");
                        goto error;
                }
@@ -604,7 +603,6 @@ int ust_registry_session_init(struct ust_registry_session **sessionp,
                        O_WRONLY | O_CREAT | O_EXCL,
                        S_IRUSR | S_IWUSR, euid, egid);
                if (ret < 0) {
-                       errno = -ret;
                        PERROR("Opening metadata file");
                        goto error;
                }
This page took 0.023716 seconds and 4 git commands to generate.