summaryrefslogtreecommitdiff
path: root/misc/util.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2003-11-20 18:34:20 -0500
committerTheodore Ts'o <tytso@mit.edu>2003-11-20 18:34:20 -0500
commitd07b150371f4a46f2729ab2635fc8f23c9ffca58 (patch)
tree1d29964af76c5c97c554662224c7555de84e9172 /misc/util.c
parent89e9fc4d3c529955d1c6fe2b251c9a94d20f30e2 (diff)
downloade2fsprogs-d07b150371f4a46f2729ab2635fc8f23c9ffca58.tar.gz
util.c (check_plausibility): Support 2.6 kernel header files,
instead of having the build to crash. (Addresses Debian bug #221778)
Diffstat (limited to 'misc/util.c')
-rw-r--r--misc/util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/misc/util.c b/misc/util.c
index 70f98b11..76392ff4 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -109,8 +109,20 @@ void check_plausibility(const char *device)
#define MINOR(dev) ((dev) & 0xff)
#endif
#ifndef SCSI_BLK_MAJOR
+#ifdef SCSI_DISK0_MAJOR
+#ifdef SCSI_DISK8_MAJOR
+#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \
+ ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR) || \
+ ((M) >= SCSI_DISK8_MAJOR && (M) <= SCSI_DISK15_MAJOR))
+#else
+#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \
+ ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR))
+#endif /* defined(SCSI_DISK8_MAJOR) */
+#define SCSI_BLK_MAJOR(M) (SCSI_DISK_MAJOR((M)) || (M) == SCSI_CDROM_MAJOR)
+#else
#define SCSI_BLK_MAJOR(M) ((M) == SCSI_DISK_MAJOR || (M) == SCSI_CDROM_MAJOR)
-#endif
+#endif /* defined(SCSI_DISK0_MAJOR) */
+#endif /* defined(SCSI_BLK_MAJOR) */
if (((MAJOR(s.st_rdev) == HD_MAJOR &&
MINOR(s.st_rdev)%64 == 0) ||
(SCSI_BLK_MAJOR(MAJOR(s.st_rdev)) &&