From e51dc192b1b82ac4291d9d2ce56db87c3e9c65c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 25 Nov 2019 17:03:29 -0500 Subject: [PATCH] Clean-up: open_pipe_cloexec() has useless boilerplate MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/fd-tracker/utils.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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 -- 2.34.1