diff mbox

[3/3] linux-user: Fix unused-but-set-variable warning

Message ID 1306932992-30075-4-git-send-email-cfergeau@redhat.com
State New
Headers show

Commit Message

Christophe Fergeau June 1, 2011, 12:56 p.m. UTC
This warning is new in gcc 4.6.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
---
 linux-user/linuxload.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c
index ac8c486..e66a4ea 100644
--- a/linux-user/linuxload.c
+++ b/linux-user/linuxload.c
@@ -57,7 +57,7 @@  static int prepare_binprm(struct linux_binprm *bprm)
 {
     struct stat		st;
     int mode;
-    int retval, id_change;
+    int retval;
 
     if(fstat(bprm->fd, &st) < 0) {
 	return(-errno);
@@ -73,14 +73,10 @@  static int prepare_binprm(struct linux_binprm *bprm)
 
     bprm->e_uid = geteuid();
     bprm->e_gid = getegid();
-    id_change = 0;
 
     /* Set-uid? */
     if(mode & S_ISUID) {
     	bprm->e_uid = st.st_uid;
-	if(bprm->e_uid != geteuid()) {
-	    id_change = 1;
-	}
     }
 
     /* Set-gid? */
@@ -91,9 +87,6 @@  static int prepare_binprm(struct linux_binprm *bprm)
      */
     if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
 	bprm->e_gid = st.st_gid;
-	if (!in_group_p(bprm->e_gid)) {
-		id_change = 1;
-	}
     }
 
     retval = read(bprm->fd, bprm->buf, BPRM_BUF_SIZE);