We are redirecting stderr, and can safely ignore any
errors from dup() here. So mark the return value as
unused.
Found by coverity.

Signed-off-by: Hannes Reinecke <[email protected]>
---
 libmultipath/callout.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libmultipath/callout.c b/libmultipath/callout.c
index d671b0c..4d1b067 100644
--- a/libmultipath/callout.c
+++ b/libmultipath/callout.c
@@ -76,8 +76,10 @@ int execute_program(char *path, char *value, int len)
                /* Ignore writes to stderr */
                null_fd = open("/dev/null", O_WRONLY);
                if (null_fd > 0) {
+                       int err_fd __attribute__ ((unused));
+
                        close(STDERR_FILENO);
-                       retval = dup(null_fd);
+                       err_fd = dup(null_fd);
                        close(null_fd);
                }
 
-- 
2.6.6

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to