summaryrefslogtreecommitdiff
path: root/mkswap.c
diff options
context:
space:
mode:
authorEric Andersen2000-10-30 17:22:04 +0000
committerEric Andersen2000-10-30 17:22:04 +0000
commitef936da7c5608c8cae553216f8661764247c2819 (patch)
treed7531d36a1dcd27c47d26707170c4711b0c73aae /mkswap.c
parent3e07541e5fec215e2d61deb48e3dc1bb460babd1 (diff)
downloadbusybox-ef936da7c5608c8cae553216f8661764247c2819.zip
busybox-ef936da7c5608c8cae553216f8661764247c2819.tar.gz
Fix uname problem that was breaking poweroff.
Diffstat (limited to 'mkswap.c')
-rw-r--r--mkswap.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/mkswap.c b/mkswap.c
index 8a9767c..627d04f 100644
--- a/mkswap.c
+++ b/mkswap.c
@@ -63,20 +63,6 @@ static int version = -1;
#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
-static int linux_version_code(void)
-{
- struct utsname my_utsname;
- int p, q, r;
-
- if (uname(&my_utsname) == 0) {
- p = atoi(strtok(my_utsname.release, "."));
- q = atoi(strtok(NULL, "."));
- r = atoi(strtok(NULL, "."));
- return MAKE_VERSION(p, q, r);
- }
- return 0;
-}
-
/*
* The definition of the union swap_header uses the constant PAGE_SIZE.
* Unfortunately, on some architectures this depends on the hardware model,
@@ -345,7 +331,7 @@ int mkswap_main(int argc, char **argv)
if (version == -1) {
if (PAGES <= V0_MAX_PAGES)
version = 0;
- else if (linux_version_code() < MAKE_VERSION(2, 1, 117))
+ else if (get_kernel_revision() < MAKE_VERSION(2, 1, 117))
version = 0;
else if (pagesize < 2048)
version = 0;
@@ -366,7 +352,7 @@ int mkswap_main(int argc, char **argv)
#else
if (!version)
maxpages = V0_MAX_PAGES;
- else if (linux_version_code() >= MAKE_VERSION(2, 2, 1))
+ else if (get_kernel_revision() >= MAKE_VERSION(2, 2, 1))
maxpages = V1_MAX_PAGES;
else {
maxpages = V1_OLD_MAX_PAGES;