summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkswap.c
diff options
context:
space:
mode:
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r--disk-utils/mkswap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 960500013..6bd96d904 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -39,9 +39,14 @@
#include <sys/ioctl.h> /* for _IO */
#include <sys/utsname.h>
#include <sys/stat.h>
+#include "nls.h"
+
+#ifdef HAVE_asm_page_h
#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */
/* we also get PAGE_SIZE via getpagesize() */
-#include "nls.h"
+/* recent glibc systems also define this in <sys/user.h> */
+#endif
+
#ifndef _IO
/* pre-1.3.45 */
@@ -609,7 +614,9 @@ the -f option to force it.\n"),
* A subsequent swapon() will fail if the signature
* is not actually on disk. (This is a kernel bug.)
*/
+#ifdef HAVE_fsync
if (fsync(DEV))
die(_("fsync failed"));
+#endif
return 0;
}