6d73e5dfdf
Signed-off-by: Karel Zak <kzak@redhat.com>
33 lines
955 B
Diff
33 lines
955 B
Diff
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.5.2
|
|
|