Fix compiler warnings

This commit is contained in:
Ryan O'Hara 2014-05-19 23:04:12 -05:00
parent 068551b8e7
commit 6659c871a5
3 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,27 @@
--- ipvsadm.c.orig 2013-09-06 04:37:27.000000000 -0400
+++ ipvsadm.c 2014-02-21 03:10:36.117000000 -0500
@@ -1240,14 +1240,13 @@
char *argv[] = { "/sbin/modprobe", "--", "ip_vs", NULL };
int child;
int status;
- int rc;
if (!(child = fork())) {
execv(argv[0], argv);
exit(1);
}
- rc = waitpid(child, &status, 0);
+ waitpid(child, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
return 1;
@@ -1429,7 +1428,7 @@
static void print_largenum(unsigned long long i, unsigned int format)
{
char mytmp[32];
- size_t len;
+ int len;
if (format & FMT_EXACT) {
len = snprintf(mytmp, 32, "%llu", i);

View File

@ -0,0 +1,30 @@
From cd824937ad6588be2ec701ee87fba6ee2626e515 Mon Sep 17 00:00:00 2001
From: Ryan O'Hara <rohara@redhat.com>
Date: Fri, 17 Jan 2014 11:53:46 -0600
Subject: [PATCH] libipvs: Initialize ipvs_service_t variable
The ipvs_get_service function declares an ipvs_service_t type variable
and initializes some of the values, but should really start by
initializing the entire structure.
Signed-off-by: Ryan O'Hara <rohara@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
libipvs/libipvs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
index d2fec49..8baafed 100644
--- a/libipvs/libipvs.c
+++ b/libipvs/libipvs.c
@@ -942,6 +942,7 @@ ipvs_get_service(__u32 fwmark, __u16 af, __u16 protocol, union nf_inet_addr addr
if (!svc)
return NULL;
+ memset(&tsvc, 0, sizeof(tsvc));
tsvc.fwmark = fwmark;
tsvc.af = af;
tsvc.protocol= protocol;
--
1.9.0

View File

@ -1,7 +1,7 @@
Name: ipvsadm
Summary: Utility to administer the Linux Virtual Server
Version: 1.27
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv2+
URL: https://kernel.org/pub/linux/utils/kernel/ipvsadm/
@ -9,6 +9,9 @@ Source0: https://kernel.org/pub/linux/utils/kernel/ipvsadm/%{name}-%{version}.ta
Source1: ipvsadm.service
Source2: ipvsadm-config
Patch0: ipvsadm-init-variable.patch
Patch1: ipvsadm-fix-warnings.patch
Buildrequires: libnl3-devel
Buildrequires: popt-devel
BuildRequires: systemd
@ -33,6 +36,8 @@ services. Supported Features include:
%prep
%setup -q
%patch0 -p1
%patch1 -p0
%build
CFLAGS="%{optflags}" make
@ -71,6 +76,9 @@ CFLAGS="%{optflags}" make
%{_mandir}/man8/%{name}-save.8*
%changelog
* Tue May 20 2014 Ryan O'Hara <rohara@redhat.com> - 1.27-4
- Fix compiler warnings
* Mon May 19 2014 Ryan O'Hara <rohara@redhat.com> - 1.27-3
- Update spec file and fix install paths