From 5c36a0eb7cdb0360f9afd5d747c321f423b35984 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:37 +0100 Subject: Imported from util-linux-2.9i tarball. --- disk-utils/fdformat.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'disk-utils/fdformat.c') diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index 46b9e2320..7f792c5c9 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); -- cgit v1.2.3-55-g7522