diff mbox

mount.cifs: silence compiler warnings about ignoring return code

Message ID 1345731505-3491-1-git-send-email-jlayton@samba.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Aug. 23, 2012, 2:18 p.m. UTC
In this case we explicitly don't care what these functions return, so
declare a couple of unused variables to catch the results.

Signed-off-by: Jeff Layton <jlayton@samba.org>
---
 mount.cifs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeff Layton Aug. 27, 2012, 1:11 p.m. UTC | #1
On Thu, 23 Aug 2012 10:18:25 -0400
Jeff Layton <jlayton@samba.org> wrote:

> In this case we explicitly don't care what these functions return, so
> declare a couple of unused variables to catch the results.
> 
> Signed-off-by: Jeff Layton <jlayton@samba.org>
> ---
>  mount.cifs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mount.cifs.c b/mount.cifs.c
> index f843bb4..3fd472a 100644
> --- a/mount.cifs.c
> +++ b/mount.cifs.c
> @@ -1964,8 +1964,8 @@ restore_privs:
>  		if (dacrc)
>  			rc = rc ? rc : dacrc;
>  	} else {
> -		setfsuid(oldfsuid);
> -		setfsgid(oldfsgid);
> +		uid_t __attribute__((unused)) uignore = setfsuid(oldfsuid);
> +		gid_t __attribute__((unused)) gignore = setfsgid(oldfsgid);
>  	}
>  
>  	return rc;

Committed...
diff mbox

Patch

diff --git a/mount.cifs.c b/mount.cifs.c
index f843bb4..3fd472a 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1964,8 +1964,8 @@  restore_privs:
 		if (dacrc)
 			rc = rc ? rc : dacrc;
 	} else {
-		setfsuid(oldfsuid);
-		setfsgid(oldfsgid);
+		uid_t __attribute__((unused)) uignore = setfsuid(oldfsuid);
+		gid_t __attribute__((unused)) gignore = setfsgid(oldfsgid);
 	}
 
 	return rc;