From: Jonathan Rajotte Date: Tue, 25 Jul 2017 20:57:50 +0000 (-0400) Subject: Cleanup: remove dead assignment X-Git-Tag: v2.11.0-rc1~482 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e7e1ef17602bc925e3271acf3c914929cee93bc5;p=lttng-tools.git Cleanup: remove dead assignment Only handle cases where the returned error is not EEXIST. ret is overwritten anyway. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index b2745086f..f9f7646ca 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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));