From: Julien Desfossez Date: Wed, 25 Apr 2012 23:05:35 +0000 (-0400) Subject: Fix bt_context_add_traces_recursive X-Git-Tag: v0.2~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7314c8557fae846e361231d2c693ef6355884133;p=lttngtop.git Fix bt_context_add_traces_recursive When an empty directory (readable by the user) is passed to this function, set the appropriate error code. Signed-off-by: Julien Desfossez --- diff --git a/src/lttngtop.c b/src/lttngtop.c index f2df936..5ab8e94 100644 --- a/src/lttngtop.c +++ b/src/lttngtop.c @@ -513,11 +513,9 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, } metafd = openat(dirfd, "metadata", O_RDONLY); if (metafd < 0) { - ret = close(dirfd); - if (ret < 0) { - perror("close"); - goto error; - } + close(dirfd); + ret = -1; + continue; } else { int trace_id;