Clean-up: open_pipe_cloexec() has useless boilerplate
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 25 Nov 2019 22:03:29 +0000 (17:03 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 25 Nov 2019 22:06:24 +0000 (17:06 -0500)
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 <jeremie.galarneau@efficios.com>
src/common/fd-tracker/utils.c

index cd4418ed28895ae9438eb73f29c5598ebdd67da9..21ca6752deb3875aa656d6dd2bab605172364672 100644 (file)
 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
This page took 0.026236 seconds and 4 git commands to generate.