From e7e1ef17602bc925e3271acf3c914929cee93bc5 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 25 Jul 2017 16:57:50 -0400 Subject: [PATCH] Cleanup: remove dead assignment MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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)); -- 2.34.1