aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mkswap.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-19 11:54:02 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-19 11:54:02 +0000
commite2e56c7c4129de7d20df42e8239fd304c81ef29b (patch)
tree0f9eb8281fac2f87c79a888dac49b27a1965b366 /util-linux/mkswap.c
parente3c150bc67cb158ee854ffb498f0066c79cd842c (diff)
downloadbusybox-w32-e2e56c7c4129de7d20df42e8239fd304c81ef29b.tar.gz
busybox-w32-e2e56c7c4129de7d20df42e8239fd304c81ef29b.tar.bz2
busybox-w32-e2e56c7c4129de7d20df42e8239fd304c81ef29b.zip
- single KERNEL_VERSION(a,b,c) macro in platform.h
- rename get_kernel_revision() to get_linux_version_code from Robert P. J. Day
Diffstat (limited to 'util-linux/mkswap.c')
-rw-r--r--util-linux/mkswap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 44d809a36..0054eca24 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -61,14 +61,14 @@ static int check = 0;
61static int badpages = 0; 61static int badpages = 0;
62#if ENABLE_FEATURE_MKSWAP_V0 62#if ENABLE_FEATURE_MKSWAP_V0
63static int version = -1; 63static int version = -1;
64#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
65#else 64#else
66#define version 1 65#define version 1
67/* and make sure that we optimize away anything which would deal with checking 66/* and make sure that we optimize away anything which would deal with checking
68 * the kernel revision as we have v1 support only anyway. 67 * the kernel revision as we have v1 support only anyway.
69 */ 68 */
70#define MAKE_VERSION(p,q,r) 1 69#undef KERNEL_VERSION
71#define get_kernel_revision() 1 70#define KERNEL_VERSION(p,q,r) 1
71#define get_linux_version_code() 1
72#endif 72#endif
73 73
74/* 74/*
@@ -293,7 +293,7 @@ int mkswap_main(int argc, char **argv)
293 if (sz & 4) { 293 if (sz & 4) {
294 version = bb_xgetlarg(tmp, 10, 0, 1); 294 version = bb_xgetlarg(tmp, 10, 0, 1);
295 } else { 295 } else {
296 if (get_kernel_revision() < MAKE_VERSION(2, 1, 117)) 296 if (get_linux_version_code() < KERNEL_VERSION(2, 1, 117))
297 version = 0; 297 version = 0;
298 else 298 else
299 version = 1; 299 version = 1;
@@ -327,7 +327,7 @@ int mkswap_main(int argc, char **argv)
327#else 327#else
328 if (!version) 328 if (!version)
329 maxpages = V0_MAX_PAGES; 329 maxpages = V0_MAX_PAGES;
330 else if (get_kernel_revision() >= MAKE_VERSION(2, 2, 1)) 330 else if (get_linux_version_code() >= KERNEL_VERSION(2,2,1))
331 maxpages = V1_MAX_PAGES; 331 maxpages = V1_MAX_PAGES;
332 else { 332 else {
333 maxpages = V1_OLD_MAX_PAGES; 333 maxpages = V1_OLD_MAX_PAGES;