ChangeLog, Makefile.in, swapfs.c, unix.c:
Makefile.in: Add message.c and swapfs.c to the list of source files to
build the make depend.
swapfs.c, unix.c: Only support the -s and -S options to e2fsck if
ENABLE_SWAPFS is defined.
Many files:
ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c,
native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the
byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a
big-endian machine.
initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set
EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag.
native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by
autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 049e273..f7ed56d 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -572,11 +572,20 @@
case 'N':
ctx->device_name = optarg;
break;
+#ifdef ENABLE_SWAPFS
case 's':
normalize_swapfs = 1;
case 'S':
swapfs = 1;
break;
+#else
+ case 's':
+ case 'S':
+ fprintf(stderr, _("Byte-swapping filesystems "
+ "not compiled in this version "
+ "of e2fsck\n"));
+ exit(1);
+#endif
default:
usage(ctx);
}
@@ -597,7 +606,7 @@
ctx->filesystem_name);
fatal_error(ctx, 0);
}
- if ((retval == ext2fs_sync_device(fd, 1))) {
+ if ((retval = ext2fs_sync_device(fd, 1))) {
com_err("ext2fs_sync_device", retval,
_("while trying to flush %s"),
ctx->filesystem_name);
@@ -605,6 +614,7 @@
}
close(fd);
}
+#ifdef ENABLE_SWAPFS
if (swapfs) {
if (cflag || bad_blocks_file) {
fprintf(stderr, _("Incompatible options not "
@@ -612,6 +622,7 @@
exit(FSCK_USAGE);
}
}
+#endif
#ifdef HAVE_SIGNAL_H
/*
* Set up signal action
@@ -880,7 +891,7 @@
test_disk(ctx);
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
fatal_error(ctx, 0);
-
+#ifdef ENABLE_SWAPFS
if (normalize_swapfs) {
if ((fs->flags & EXT2_FLAG_SWAP_BYTES) ==
ext2fs_native_flag()) {
@@ -894,6 +905,7 @@
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
fatal_error(ctx, 0);
}
+#endif
/*
* Mark the system as valid, 'til proven otherwise