summaryrefslogtreecommitdiff
path: root/testing/util-linux/two-component-linux.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/util-linux/two-component-linux.patch')
-rw-r--r--testing/util-linux/two-component-linux.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/util-linux/two-component-linux.patch b/testing/util-linux/two-component-linux.patch
new file mode 100644
index 000000000..1b65ca295
--- /dev/null
+++ b/testing/util-linux/two-component-linux.patch
@@ -0,0 +1,32 @@
+From fa7e0d6d442de9f5940f99fd93f4522602439131 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Mon, 6 Jun 2011 12:35:26 +0200
+Subject: [PATCH] lib: [linux_version.c] accommodate two-component linux
+ version (e.g. 3.0)
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ lib/linux_version.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/linux_version.c b/lib/linux_version.c
+index f9fbd8d..ada566a 100644
+--- a/lib/linux_version.c
++++ b/lib/linux_version.c
+@@ -16,10 +16,10 @@ get_linux_version (void)
+ return kver;
+ if (uname (&uts))
+ kver = 0;
+- else if (sscanf (uts.release, "%d.%d.%d", &major, &minor, &teeny) != 3)
+- kver = 0;
+- else
++ else if (sscanf (uts.release, "%d.%d.%d", &major, &minor, &teeny) == 3)
+ kver = KERNEL_VERSION (major, minor, teeny);
++ else if (sscanf (uts.release, "%d.%d", &major, &minor) == 2)
++ kver = KERNEL_VERSION (major, minor, 0);
+
+ return kver;
+ }
+--
+1.7.6
+