From: Jérémie Galarneau Date: Mon, 25 Nov 2019 22:03:29 +0000 (-0500) Subject: Clean-up: open_pipe_cloexec() has useless boilerplate X-Git-Tag: v2.12.0-rc1~215 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e51dc192b1b82ac4291d9d2ce56db87c3e9c65c5;p=lttng-tools.git Clean-up: open_pipe_cloexec() has useless boilerplate The open_pipe_cloexec() wrapper can be simplified to simply call utils_create_pipe_cloexec(). This eliminates a warning of Coverity. 1407700 Identical code for different branches The condition is redundant In open_pipe_cloexec: The same code is executed regardless of the condition (CWE-398) Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/fd-tracker/utils.c b/src/common/fd-tracker/utils.c index cd4418ed2..21ca6752d 100644 --- a/src/common/fd-tracker/utils.c +++ b/src/common/fd-tracker/utils.c @@ -24,14 +24,7 @@ static int open_pipe_cloexec(void *data, int *fds) { - int ret; - - ret = utils_create_pipe_cloexec(fds); - if (ret < 0) { - goto end; - } -end: - return ret; + return utils_create_pipe_cloexec(fds); } static