From: David Goulet Date: Thu, 30 Jun 2011 20:39:33 +0000 (-0400) Subject: Overwrite the config file on create session X-Git-Tag: v2.0-pre1~57 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0f7a07a734ff993a3cf4d132003398f1f7c1e2f4;p=lttng-tools.git Overwrite the config file on create session Signed-off-by: David Goulet --- diff --git a/lttng/conf.c b/lttng/conf.c index 57aaf7b2d..ac1c17296 100644 --- a/lttng/conf.c +++ b/lttng/conf.c @@ -109,14 +109,14 @@ static int create_config_dir(char *path) /* Create session directory .lttng */ ret = mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP); if (ret < 0) { - if (errno == EEXIST) { - ERR("Session already exist at %s", path); - } else { + if (errno != EEXIST) { perror("mkdir config"); ERR("Couldn't init config directory at %s", path); + ret = -errno; + goto error; + } else { + ret = 0; } - ret = -errno; - goto error; } error: