summaryrefslogtreecommitdiff
path: root/fdisk/fdisksunlabel.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2006-12-07 00:26:05 +0100
committerKarel Zak <kzak@redhat.com>2006-12-07 00:26:05 +0100
commit95f1bdeee42cd7b9ac49d64b27bcec49557a991e (patch)
tree5813d335771188c724c3d1bc9f9f9feb23c1d9ca /fdisk/fdisksunlabel.c
parent24f4bbff7f0a9b01f5a9fb0a4c1eff5b05b15f6f (diff)
downloadutil-linux-old-95f1bdeee42cd7b9ac49d64b27bcec49557a991e.tar.gz
Imported from util-linux-2.11x tarball.
Diffstat (limited to 'fdisk/fdisksunlabel.c')
-rw-r--r--fdisk/fdisksunlabel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fdisk/fdisksunlabel.c b/fdisk/fdisksunlabel.c
index 1827fb06..8d6a2041 100644
--- a/fdisk/fdisksunlabel.c
+++ b/fdisk/fdisksunlabel.c
@@ -16,6 +16,8 @@
#include <unistd.h> /* write */
#include <sys/ioctl.h> /* ioctl */
#include <sys/stat.h> /* stat */
+#include <sys/sysmacros.h> /* major */
+
#include "nls.h"
#include <endian.h>
@@ -82,12 +84,12 @@ void guess_device_type(int fd) {
scsi_disk = 0;
floppy = 0;
} else if (S_ISBLK(bootstat.st_mode)
- && ((bootstat.st_rdev >> 8) == IDE0_MAJOR ||
- (bootstat.st_rdev >> 8) == IDE1_MAJOR)) {
+ && (major(bootstat.st_rdev) == IDE0_MAJOR ||
+ major(bootstat.st_rdev) == IDE1_MAJOR)) {
scsi_disk = 0;
floppy = 0;
} else if (S_ISBLK(bootstat.st_mode)
- && (bootstat.st_rdev >> 8) == FLOPPY_MAJOR) {
+ && major(bootstat.st_rdev) == FLOPPY_MAJOR) {
scsi_disk = 0;
floppy = 1;
} else {