summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdformat.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:58 +0100
committerKarel Zak2006-12-07 00:25:58 +0100
commit63cccae4684f83d2a462bc8abf24e51d1bd6efb6 (patch)
tree433db3f0b44e0f46e4130141f4a59db9c3564557 /disk-utils/fdformat.c
parentImported from util-linux-2.11r tarball. (diff)
downloadkernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.gz
kernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.xz
kernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.zip
Imported from util-linux-2.11t tarball.
Diffstat (limited to 'disk-utils/fdformat.c')
-rw-r--r--disk-utils/fdformat.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index e479059c3..e1b381173 100644
--- a/disk-utils/fdformat.c
+++ b/disk-utils/fdformat.c
@@ -18,12 +18,8 @@
#include "nls.h"
-/* cannot include <linux/fs.h> */
-#define MAJOR(a) ((a)>>8)
-
struct floppy_struct param;
-#define FLOPPY_MAJOR 2
#define SECTOR_SIZE 512
#define PERROR(msg) { perror(msg); exit(1); }
@@ -130,9 +126,10 @@ int main(int argc,char **argv)
}
if (argc != 2) usage(progname);
if (stat(argv[1],&st) < 0) PERROR(argv[1]);
- if (!S_ISBLK(st.st_mode) || MAJOR(st.st_rdev) != FLOPPY_MAJOR) {
- fprintf(stderr,_("%s: not a floppy device\n"),argv[1]);
+ if (!S_ISBLK(st.st_mode)) {
+ fprintf(stderr,_("%s: not a block device\n"),argv[1]);
exit(1);
+ /* do not test major - perhaps this was an USB floppy */
}
if (access(argv[1],W_OK) < 0) PERROR(argv[1]);