From: Theodore Ts'o Date: Thu, 20 Nov 2003 23:34:20 +0000 (-0500) Subject: util.c (check_plausibility): Support 2.6 kernel header files, X-Git-Tag: E2FSPROGS-1_35-WIP-1207~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d07b150371f4a46f2729ab2635fc8f23c9ffca58;p=thirdparty%2Fe2fsprogs.git util.c (check_plausibility): Support 2.6 kernel header files, instead of having the build to crash. (Addresses Debian bug #221778) --- diff --git a/misc/ChangeLog b/misc/ChangeLog index 0d0026de9..697343155 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2003-11-20 Theodore Ts'o + + * util.c (check_plausibility): Support 2.6 kernel header files, + instead of having the build to crash. (Addresses Debian + bug #221778) + 2003-09-01 Theodore Ts'o * mke2fs.c (progress_init, progress_update): If the environment diff --git a/misc/util.c b/misc/util.c index 70f98b118..76392ff46 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)) &&