Cleanup: remove dead assignment
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 25 Jul 2017 20:57:50 +0000 (16:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 28 Jul 2017 18:00:47 +0000 (14:00 -0400)
Only handle cases where the returned error is not EEXIST. ret is
overwritten anyway.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index b2745086f3860fab9062d5b24ed995d4cfab9325..f9f7646ca05b82ac08b27a77cc2b2e58b58ba8ce 100644 (file)
@@ -5408,13 +5408,10 @@ static int set_consumer_sockets(struct consumer_data *consumer_data,
        DBG2("Creating consumer directory: %s", path);
 
        ret = mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP);
-       if (ret < 0) {
-               if (errno != EEXIST) {
-                       PERROR("mkdir");
-                       ERR("Failed to create %s", path);
-                       goto error;
-               }
-               ret = -1;
+       if (ret < 0 && errno != EEXIST) {
+               PERROR("mkdir");
+               ERR("Failed to create %s", path);
+               goto error;
        }
        if (is_root) {
                ret = chown(path, 0, utils_get_group_id(tracing_group_name));
This page took 0.037032 seconds and 4 git commands to generate.