diff options
author | Karel Zak | 2009-10-15 14:14:32 +0200 |
---|---|---|
committer | Karel Zak | 2009-10-15 14:14:32 +0200 |
commit | e98754d6bbd277902f4e5e8190b29ece5d4376ec (patch) | |
tree | ea79a5fc2c0ba655c78fda16b76fc4f0c8130c26 /disk-utils/mkfs.minix.c | |
parent | blockdev: fix topology ioctls (diff) | |
download | kernel-qcow2-util-linux-e98754d6bbd277902f4e5e8190b29ece5d4376ec.tar.gz kernel-qcow2-util-linux-e98754d6bbd277902f4e5e8190b29ece5d4376ec.tar.xz kernel-qcow2-util-linux-e98754d6bbd277902f4e5e8190b29ece5d4376ec.zip |
fsck.minix: fix broken zone checking
This bug has been introduced by commit
95356e8b744439336925eeb36f01399f1ee8a5e9.
The fsck.minix code assumes that isset() macro returns boolean,
unfortunately the generic implementation from libc returns integer.
This patch also add a fallback for the bitmap macros to include/bitops.h.
Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/mkfs.minix.c')
-rw-r--r-- | disk-utils/mkfs.minix.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index ebef5188e..391f09b84 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -68,7 +68,6 @@ #include <stdlib.h> #include <termios.h> #include <sys/stat.h> -#include <sys/param.h> #include <mntent.h> #include <getopt.h> @@ -76,6 +75,7 @@ #include "minix.h" #include "nls.h" #include "pathnames.h" +#include "bitops.h" #define MINIX_ROOT_INO 1 #define MINIX_BAD_INO 2 @@ -131,8 +131,7 @@ static unsigned short good_blocks_table[MAX_GOOD_BLOCKS]; static int used_good_blocks = 0; static unsigned long req_nr_inodes = 0; -#define inode_in_use(x) (isset(inode_map,(x))) -#define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1)) +#define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1) != 0) #define mark_inode(x) (setbit(inode_map,(x))) #define unmark_inode(x) (clrbit(inode_map,(x))) |