Message ID | 1466070465-1021-36-git-send-email-hare@suse.de (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | christophe varoqui |
Headers | show |
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); }
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@suse.com> --- libmultipath/callout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)