All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: lvs-devel@vger.kernel.org, Daniel Borkmann <dborkman@redhat.com>
Cc: Wensong Zhang <wensong@linux-vs.org>,
	Julian Anastasov <ja@ssi.bg>, Simon Horman <horms@verge.net.au>,
	Ryan O'Hara <rohara@redhat.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Subject: [ipvsadm PATCH 2/2] ipvsadm: fix compile warning in modprobe_ipvs
Date: Thu, 04 Dec 2014 10:39:00 +0100	[thread overview]
Message-ID: <20141204093900.20470.29631.stgit@localhost> (raw)
In-Reply-To: <20141204093757.20470.92421.stgit@localhost>

From: Daniel Borkmann <dborkman@redhat.com>

ipvsadm.c: In function ‘modprobe_ipvs’:
ipvsadm.c:1249:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
  int rc;
      ^
Address this by also checking if waitpid(2) returned successfully
before we check actual status information.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
 ipvsadm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipvsadm.c b/ipvsadm.c
index 8931412..72ddc8a 100644
--- a/ipvsadm.c
+++ b/ipvsadm.c
@@ -1255,7 +1255,7 @@ static int modprobe_ipvs(void)
 
 	rc = waitpid(child, &status, 0);
 
-	if (!WIFEXITED(status) || WEXITSTATUS(status)) {
+	if (rc == -1 || !WIFEXITED(status) || WEXITSTATUS(status)) {
 		return 1;
 	}
 


  parent reply	other threads:[~2014-12-04  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  9:38 [ipvsadm PATCH 0/2] trivial compile warning fixes for ipvsadm Jesper Dangaard Brouer
2014-12-04  9:38 ` [ipvsadm PATCH 1/2] ipvsadm: fix compile warning in print_largenum Jesper Dangaard Brouer
2014-12-04  9:39 ` Jesper Dangaard Brouer [this message]
2014-12-04 12:23 ` [ipvsadm PATCH 0/2] trivial compile warning fixes for ipvsadm Simon Horman
2014-12-07 18:30 ` Julian Anastasov
2014-12-09  9:55 ` Jesper Dangaard Brouer

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=20141204093900.20470.29631.stgit@localhost \
    --to=brouer@redhat.com \
    --cc=dborkman@redhat.com \
    --cc=horms@verge.net.au \
    --cc=ja@ssi.bg \
    --cc=lvs-devel@vger.kernel.org \
    --cc=rohara@redhat.com \
    --cc=wensong@linux-vs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.