[ipvsadm PATCH 2/2] ipvsadm: fix compile warning in modprobe_ipvs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Filesystem Devel]     [Linux NFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [X.Org]

  Powered by Linux