[PATCH 35/39] libmultipath: mark return value from dup() as unused

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <hare@xxxxxxxx>
---
 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
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux