Lines 18-26
Link Here
|
18 |
#ifdef HAVE_ERRNO_H |
18 |
#ifdef HAVE_ERRNO_H |
19 |
#include <errno.h> |
19 |
#include <errno.h> |
20 |
#endif |
20 |
#endif |
21 |
#ifdef HAVE_LINUX_MAJOR_H |
|
|
22 |
#include <linux/major.h> |
23 |
#endif |
24 |
#ifdef HAVE_SYS_STAT_H |
21 |
#ifdef HAVE_SYS_STAT_H |
25 |
#include <sys/stat.h> |
22 |
#include <sys/stat.h> |
26 |
#endif |
23 |
#endif |
Lines 104-139
void check_plausibility(const char *device)
Link Here
|
104 |
proceed_question(); |
101 |
proceed_question(); |
105 |
return; |
102 |
return; |
106 |
} |
103 |
} |
107 |
|
|
|
108 |
#ifdef HAVE_LINUX_MAJOR_H |
109 |
#ifndef MAJOR |
110 |
#define MAJOR(dev) ((dev)>>8) |
111 |
#define MINOR(dev) ((dev) & 0xff) |
112 |
#endif |
113 |
#ifndef SCSI_BLK_MAJOR |
114 |
#ifdef SCSI_DISK0_MAJOR |
115 |
#ifdef SCSI_DISK8_MAJOR |
116 |
#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \ |
117 |
((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR) || \ |
118 |
((M) >= SCSI_DISK8_MAJOR && (M) <= SCSI_DISK15_MAJOR)) |
119 |
#else |
120 |
#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \ |
121 |
((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR)) |
122 |
#endif /* defined(SCSI_DISK8_MAJOR) */ |
123 |
#define SCSI_BLK_MAJOR(M) (SCSI_DISK_MAJOR((M)) || (M) == SCSI_CDROM_MAJOR) |
124 |
#else |
125 |
#define SCSI_BLK_MAJOR(M) ((M) == SCSI_DISK_MAJOR || (M) == SCSI_CDROM_MAJOR) |
126 |
#endif /* defined(SCSI_DISK0_MAJOR) */ |
127 |
#endif /* defined(SCSI_BLK_MAJOR) */ |
128 |
if (((MAJOR(s.st_rdev) == HD_MAJOR && |
129 |
MINOR(s.st_rdev)%64 == 0) || |
130 |
(SCSI_BLK_MAJOR(MAJOR(s.st_rdev)) && |
131 |
MINOR(s.st_rdev)%16 == 0))) { |
132 |
printf(_("%s is entire device, not just one partition!\n"), |
133 |
device); |
134 |
proceed_question(); |
135 |
} |
136 |
#endif |
137 |
} |
104 |
} |
138 |
|
105 |
|
139 |
void check_mount(const char *device, int force, const char *type) |
106 |
void check_mount(const char *device, int force, const char *type) |