From: David Goulet Date: Thu, 8 Mar 2012 23:10:38 +0000 (-0500) Subject: Fix wrong return value on consumer socket creation X-Git-Tag: v2.0.0-rc3~9 X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=f11e84c2c33f6e2f4da8436012bcc61b3291b0d7 Fix wrong return value on consumer socket creation A failing call to mkdir() returned 0 instead of an error and was creating a segfault later on since some memory was not initialized. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 076aac54b..6c7ed1fd6 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4252,10 +4252,11 @@ static int set_consumer_sockets(struct consumer_data *consumer_data, ret = mkdir(path, S_IRWXU); if (ret < 0) { if (errno != EEXIST) { + PERROR("mkdir"); ERR("Failed to create %s", path); goto error; } - ret = 0; + ret = -1; } /* Create the kconsumerd error unix socket */