From: Mathieu Desnoyers Date: Sat, 14 Dec 2013 15:36:13 +0000 (-0500) Subject: lttng-live: fix unchecked mkdir return value X-Git-Tag: v1.2.0-rc1~25 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=ab9d07f05dbce9f494f0ae874911d8c6f39b04d6 lttng-live: fix unchecked mkdir return value Found by coverity: ** CID 1136989: Unchecked return value from library (CHECKED_RETURN) /formats/lttng-live/lttng-live-functions.c: 374 in lttng_live_attach_session() Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/lttng-live/lttng-live-functions.c b/formats/lttng-live/lttng-live-functions.c index 34612cf7..9de53ae5 100644 --- a/formats/lttng-live/lttng-live-functions.c +++ b/formats/lttng-live/lttng-live-functions.c @@ -371,7 +371,6 @@ int lttng_live_attach_session(struct lttng_live_ctx *ctx, uint64_t id) path = strdup(LTTNG_METADATA_PATH_TEMPLATE); path = mkdtemp(path); ctx->session->streams[i].metadata_flag = 1; - mkdir(path, S_IRWXU | S_IRWXG); snprintf(ctx->session->streams[i].path, sizeof(ctx->session->streams[i].path), "%s/%s", path, @@ -380,6 +379,7 @@ int lttng_live_attach_session(struct lttng_live_ctx *ctx, uint64_t id) O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (ret < 0) { + perror("open"); goto error; } ctx->session->streams[i].fd = ret;