diff options
author | Samuel Thibault | 2008-04-22 03:11:48 +0200 |
---|---|---|
committer | Karel Zak | 2008-07-24 00:52:13 +0200 |
commit | ff035f67ed16dc205c8c8870de0c0c9ed8816ce6 (patch) | |
tree | 32c2ef9daed9311617226216fd82ee1409d5e834 /disk-utils/mkswap.c | |
parent | build-sys: cleanup sys-utils/Makefile.am (diff) | |
download | kernel-qcow2-util-linux-ff035f67ed16dc205c8c8870de0c0c9ed8816ce6.tar.gz kernel-qcow2-util-linux-ff035f67ed16dc205c8c8870de0c0c9ed8816ce6.tar.xz kernel-qcow2-util-linux-ff035f67ed16dc205c8c8870de0c0c9ed8816ce6.zip |
mkswap: non-linux support
GNU/Hurd uses linux-like swapspace, so mkswap makes sense on
non-linux platforms too.
[kzak@redhat.com: split the original patch to small patches]
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r-- | disk-utils/mkswap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 3f58f9c30..8bf358ed3 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -607,9 +607,12 @@ main(int argc, char ** argv) { version = 1; else /* use version 1 as default, if possible */ +#ifdef __linux__ if (get_linux_version() < KERNEL_VERSION(2,1,117)) version = 0; - else if (pagesize < 2048) + else +#endif + if (pagesize < 2048) version = 0; else version = 1; @@ -629,10 +632,12 @@ main(int argc, char ** argv) { if (version == 0) maxpages = V0_MAX_PAGES; +#ifdef __linux__ else if (get_linux_version() >= KERNEL_VERSION(2,3,4)) maxpages = PAGES; else if (get_linux_version() >= KERNEL_VERSION(2,2,1)) maxpages = V1_MAX_PAGES; +#endif else maxpages = V1_OLD_MAX_PAGES; |