[net-tools] Update for 2 digit Linux version numbers (#718610)

Jiří Popelka jpopelka at fedoraproject.org
Mon Jul 4 10:56:29 UTC 2011


commit 5d62a2fcc5e8110caee01e5172c7c1bf89803718
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Mon Jul 4 12:56:07 2011 +0200

    Update for 2 digit Linux version numbers (#718610)

 net-tools-1.60-2digit.patch |   22 ++++++++++++++++++++++
 net-tools.spec              |    9 ++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/net-tools-1.60-2digit.patch b/net-tools-1.60-2digit.patch
new file mode 100644
index 0000000..e536e66
--- /dev/null
+++ b/net-tools-1.60-2digit.patch
@@ -0,0 +1,22 @@
+diff -up net-tools-1.60/lib/util.c.2digit net-tools-1.60/lib/util.c
+--- net-tools-1.60/lib/util.c.2digit	1999-01-09 16:55:29.000000000 +0100
++++ net-tools-1.60/lib/util.c	2011-07-04 12:35:45.000000000 +0200
+@@ -33,13 +33,14 @@ void *xrealloc(void *oldp, size_t sz)
+ int kernel_version(void)
+ {
+     struct utsname uts;
+-    int major, minor, patch;
++    int ret, major = 0, minor = 0, patch = 0;
+ 
+     if (uname(&uts) < 0)
+ 	return -1;
+-    if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
+-	return -1;
+-    return KRELEASE(major, minor, patch);
++    ret = sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch);
++    if (((ret == 3) && (major >= 2)) || ((ret == 2) && (major >= 3)))
++        return KRELEASE(major, minor, patch);
++    return -1;
+ }
+ 
+ 
diff --git a/net-tools.spec b/net-tools.spec
index bf2dde3..25ff1a8 100644
--- a/net-tools.spec
+++ b/net-tools.spec
@@ -1,7 +1,7 @@
 Summary: Basic networking tools
 Name: net-tools
 Version: 1.60
-Release: 121%{?dist}
+Release: 122%{?dist}
 License: GPL+
 Group: System Environment/Base
 URL: http://net-tools.berlios.de/
@@ -145,6 +145,9 @@ Patch93: net-tools-1.60-netstat-p-basename.patch
 # Possible problems found by static analysis of code.
 Patch94: net-tools-1.60-coverity.patch
 
+# Update for 2 digit Linux version numbers
+Patch95: net-tools-1.60-2digit.patch
+
 BuildRequires: gettext, libselinux
 BuildRequires: libselinux-devel
 BuildRequires: systemd-units
@@ -238,6 +241,7 @@ Most of them are obsolete. For replacement check iproute package.
 %patch92 -p1 -b .plipconfig
 %patch93 -p1 -b .p-basename
 %patch94 -p1 -b .coverity
+%patch95 -p1 -b .2digit
 
 cp %SOURCE1 ./config.h
 cp %SOURCE2 ./config.make
@@ -341,6 +345,9 @@ fi
 %attr(0644,root,root)   %{_unitdir}/arp-ethers.service
 
 %changelog
+* Mon Jul 04 2011 Jiri Popelka <jpopelka at redhat.com> - 1.60-122
+- Update for 2 digit Linux version numbers (#718610)
+
 * Fri Jun 17 2011 Jiri Popelka <jpopelka at redhat.com> - 1.60-121
 - Added arp-ethers.service systemd unit file to run 'arp -f /etc/ethers'
   on startup of system. Don't ship default /etc/ethers (#713759)


More information about the scm-commits mailing list