aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mkswap.c10
-rw-r--r--util-linux/nfsmount.c13
2 files changed, 11 insertions, 12 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;
static int badpages = 0;
#if ENABLE_FEATURE_MKSWAP_V0
static int version = -1;
-#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
#else
#define version 1
/* and make sure that we optimize away anything which would deal with checking
* the kernel revision as we have v1 support only anyway.
*/
-#define MAKE_VERSION(p,q,r) 1
-#define get_kernel_revision() 1
+#undef KERNEL_VERSION
+#define KERNEL_VERSION(p,q,r) 1
+#define get_linux_version_code() 1
#endif
/*
@@ -293,7 +293,7 @@ int mkswap_main(int argc, char **argv)
if (sz & 4) {
version = bb_xgetlarg(tmp, 10, 0, 1);
} else {
- if (get_kernel_revision() < MAKE_VERSION(2, 1, 117))
+ if (get_linux_version_code() < KERNEL_VERSION(2, 1, 117))
version = 0;
else
version = 1;
@@ -327,7 +327,7 @@ int mkswap_main(int argc, char **argv)
#else
if (!version)
maxpages = V0_MAX_PAGES;
- else if (get_kernel_revision() >= MAKE_VERSION(2, 2, 1))
+ else if (get_linux_version_code() >= KERNEL_VERSION(2,2,1))
maxpages = V1_MAX_PAGES;
else {
maxpages = V1_OLD_MAX_PAGES;
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index be0c87f71..7b742cb5f 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -214,7 +214,6 @@ enum {
static char *nfs_strerror(int status);
-#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
enum {
@@ -249,13 +248,13 @@ find_kernel_nfs_mount_version(void)
nfs_mount_version = NFS_MOUNT_VERSION; /* default */
- kernel_version = get_kernel_revision();
+ kernel_version = get_linux_version_code();
if (kernel_version) {
- if (kernel_version < MAKE_VERSION(2,1,32))
+ if (kernel_version < KERNEL_VERSION(2,1,32))
nfs_mount_version = 1;
- else if (kernel_version < MAKE_VERSION(2,2,18) ||
- (kernel_version >= MAKE_VERSION(2,3,0) &&
- kernel_version < MAKE_VERSION(2,3,99)))
+ else if (kernel_version < KERNEL_VERSION(2,2,18) ||
+ (kernel_version >= KERNEL_VERSION(2,3,0) &&
+ kernel_version < KERNEL_VERSION(2,3,99)))
nfs_mount_version = 3;
else
nfs_mount_version = 4; /* since 2.3.99pre4 */
@@ -844,7 +843,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
* to avoid problems with multihomed hosts.
* --Swen
*/
- if (get_kernel_revision() <= 66314
+ if (get_linux_version_code() <= KERNEL_VERSION(2,3,10)
&& connect(fsock, (struct sockaddr *) &server_addr,
sizeof (server_addr)) < 0) {
perror(_("nfs connect"));