From: Christophe Fergeau <cfergeau@redhat.com>
To: qemu-devel@nongnu.org
Cc: Christophe Fergeau <cfergeau@redhat.com>
Subject: [Qemu-devel] [PATCH 3/3] linux-user: Fix unused-but-set-variable warning
Date: Wed, 1 Jun 2011 14:56:32 +0200 [thread overview]
Message-ID: <1306932992-30075-4-git-send-email-cfergeau@redhat.com> (raw)
In-Reply-To: <1306932992-30075-1-git-send-email-cfergeau@redhat.com>
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 --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);
--
1.7.5.2
prev parent reply other threads:[~2011-06-01 12:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 12:56 [Qemu-devel] [PATCH 0/3] Fix unused-but-set-variable warnings Christophe Fergeau
2011-06-01 12:56 ` [Qemu-devel] [PATCH 1/3] lsi: Fix unused-but-set-variable warning Christophe Fergeau
2011-06-01 14:19 ` Paolo Bonzini
2011-06-10 16:36 ` Peter Maydell
2011-06-10 19:21 ` Richard Henderson
2011-06-10 18:45 ` Stefan Hajnoczi
2011-06-01 12:56 ` [Qemu-devel] [PATCH 2/3] ehci: " Christophe Fergeau
2011-06-01 15:53 ` David Ahern
2011-06-01 16:21 ` Christophe Fergeau
2011-06-01 12:56 ` Christophe Fergeau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1306932992-30075-4-git-send-email-cfergeau@redhat.com \
--to=cfergeau@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).