diff options
author | Karel Zak <kzak@redhat.com> | 2006-12-07 00:25:37 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2006-12-07 00:25:37 +0100 |
commit | 5c36a0eb7cdb0360f9afd5d747c321f423b35984 (patch) | |
tree | 147599a77eaff2b5fbc0d389e89d2b51602326c0 /disk-utils/fdformat.c | |
parent | 2b6fc908bc368b540845a313c3b8a867c5ad9a42 (diff) | |
download | util-linux-old-5c36a0eb7cdb0360f9afd5d747c321f423b35984.tar.gz |
Imported from util-linux-2.9i tarball.
Diffstat (limited to 'disk-utils/fdformat.c')
-rw-r--r-- | disk-utils/fdformat.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index 46b9e232..7f792c5c 100644 --- a/disk-utils/fdformat.c +++ b/disk-utils/fdformat.c @@ -56,9 +56,19 @@ static void verify_disk(char *name) fflush(stdout); if ((fd = open(name,O_RDONLY)) < 0) PERROR(name); for (cyl = 0; cyl < param.track; cyl++) { + int read_bytes; + printf("%3d\b\b\b",cyl); fflush(stdout); - if (read(fd,data,cyl_size) != cyl_size) PERROR("read"); + read_bytes = read(fd,data,cyl_size); + if(read_bytes != cyl_size) { + if(read_bytes < 0) + perror("Read: "); + fprintf(stderr, + "Problem reading cylinder %d, expected %d, read %d\n", + cyl, cyl_size, read_bytes); + exit(1); + } for (count = 0; count < cyl_size; count++) if (data[count] != FD_FILL_BYTE) { printf("bad data in cyl %d\nContinuing ... ",cyl); |