![]()  | 
 
lvs-devel
 
 | 
| To: | lvs-devel@xxxxxxxxxxxxxxx, Daniel Borkmann <dborkman@xxxxxxxxxx> | 
|---|---|
| Subject: | [ipvsadm PATCH 2/2] ipvsadm: fix compile warning in modprobe_ipvs | 
| Cc: | Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>, "Ryan O'Hara" <rohara@xxxxxxxxxx>, Jesper Dangaard Brouer <brouer@xxxxxxxxxx> | 
| From: | Jesper Dangaard Brouer <brouer@xxxxxxxxxx> | 
| Date: | Thu, 04 Dec 2014 10:39:00 +0100 | 
From: Daniel Borkmann <dborkman@xxxxxxxxxx>
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@xxxxxxxxxx>
Signed-off-by: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
---
 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;
        }
 
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
 | 
| <Prev in Thread] | Current Thread | [Next in Thread> | 
|---|---|---|
  | ||
| Previous by Date: | [ipvsadm PATCH 0/2] trivial compile warning fixes for ipvsadm, Jesper Dangaard Brouer | 
|---|---|
| Next by Date: | Re: [ipvsadm PATCH 0/2] trivial compile warning fixes for ipvsadm, Simon Horman | 
| Previous by Thread: | [ipvsadm PATCH 1/2] ipvsadm: fix compile warning in print_largenum, Jesper Dangaard Brouer | 
| Next by Thread: | Re: [ipvsadm PATCH 0/2] trivial compile warning fixes for ipvsadm, Simon Horman | 
| Indexes: | [Date] [Thread] [Top] [All Lists] |