From: David Goulet Date: Wed, 26 Mar 2014 15:26:15 +0000 (-0400) Subject: Fix: bad errno handling in load session from path X-Git-Tag: v2.5.0-rc1~86 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0f0a81b5a7ec4416774fb49ece29a8483ecdade4;p=lttng-tools.git Fix: bad errno handling in load session from path Signed-off-by: David Goulet --- diff --git a/src/common/config/config.c b/src/common/config/config.c index 0e9e1bdc7..e61791b7d 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -2344,13 +2344,14 @@ int load_session_from_path(const char *path, const char *session_name, if (!directory) { switch (errno) { case ENOTDIR: - ret = -LTTNG_ERR_LOAD_IO_FAIL; - goto end; + /* Try the file loading. */ + break; case ENOENT: ret = -LTTNG_ERR_LOAD_SESSION_NOENT; goto end; default: - break; + ret = -LTTNG_ERR_LOAD_IO_FAIL; + goto end; } } if (directory) {