diff options
author | Karel Zak | 2016-03-09 11:49:42 +0100 |
---|---|---|
committer | Karel Zak | 2016-03-09 11:49:42 +0100 |
commit | d404065a82187c8e71cf82e95ab503ff00608722 (patch) | |
tree | b05034761e8ac5dd67c28863ca4c83938789ec42 | |
parent | cal: remove libtermcap arguments to my_tgetstr() (diff) | |
download | kernel-qcow2-util-linux-d404065a82187c8e71cf82e95ab503ff00608722.tar.gz kernel-qcow2-util-linux-d404065a82187c8e71cf82e95ab503ff00608722.tar.xz kernel-qcow2-util-linux-d404065a82187c8e71cf82e95ab503ff00608722.zip |
lib/linux_version: avoid major and minor shadowing
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | lib/linux_version.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/linux_version.c b/lib/linux_version.c index 2bcc2cc65..22f6a02d7 100644 --- a/lib/linux_version.c +++ b/lib/linux_version.c @@ -1,25 +1,24 @@ #include <stdio.h> #include <sys/utsname.h> +#include "c.h" #include "linux_version.h" int get_linux_version (void) { static int kver = -1; struct utsname uts; - int major = 0; - int minor = 0; - int teeny = 0; + int x = 0, y = 0, z = 0; int n; if (kver != -1) return kver; - if (uname (&uts)) + if (uname(&uts)) return kver = 0; - n = sscanf(uts.release, "%d.%d.%d", &major, &minor, &teeny); + n = sscanf(uts.release, "%d.%d.%d", &x, &y, &z); if (n < 1 || n > 3) return kver = 0; - return kver = KERNEL_VERSION(major, minor, teeny); + return kver = KERNEL_VERSION(x, y, y); } |