diff options
Diffstat (limited to 'sbin/fsck_ext2fs')
-rw-r--r-- | sbin/fsck_ext2fs/utilities.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/fsck_ext2fs/utilities.c b/sbin/fsck_ext2fs/utilities.c index 402d37b74c7..1cbc517a4c8 100644 --- a/sbin/fsck_ext2fs/utilities.c +++ b/sbin/fsck_ext2fs/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.15 2006/03/30 01:16:30 deraadt Exp $ */ +/* $OpenBSD: utilities.c,v 1.16 2006/04/02 00:48:35 deraadt Exp $ */ /* $NetBSD: utilities.c,v 1.6 2001/02/04 21:19:34 christos Exp $ */ /* @@ -285,19 +285,19 @@ bread(int fd, char *buf, daddr_t blk, long size) offset = blk; offset *= dev_bsize; - if (lseek(fd, offset, 0) < 0) + if (lseek(fd, offset, SEEK_SET) < 0) rwerror("SEEK", blk); else if (read(fd, buf, (int)size) == size) return (0); rwerror("READ", blk); - if (lseek(fd, offset, 0) < 0) + if (lseek(fd, offset, SEEK_SET) < 0) rwerror("SEEK", blk); errs = 0; memset(buf, 0, (size_t)size); printf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:"); for (cp = buf, i = 0; i < size; i += secsize, cp += secsize) { if (read(fd, cp, (int)secsize) != secsize) { - (void)lseek(fd, offset + i + secsize, 0); + (void)lseek(fd, offset + i + secsize, SEEK_SET); if (secsize != dev_bsize && dev_bsize != 1) printf(" %ld (%ld),", (blk * dev_bsize + i) / secsize, @@ -322,19 +322,19 @@ bwrite(int fd, char *buf, daddr_t blk, long size) return; offset = blk; offset *= dev_bsize; - if (lseek(fd, offset, 0) < 0) + if (lseek(fd, offset, SEEK_SET) < 0) rwerror("SEEK", blk); else if (write(fd, buf, (int)size) == size) { fsmodified = 1; return; } rwerror("WRITE", blk); - if (lseek(fd, offset, 0) < 0) + if (lseek(fd, offset, SEEK_SET) < 0) rwerror("SEEK", blk); printf("THE FOLLOWING SECTORS COULD NOT BE WRITTEN:"); for (cp = buf, i = 0; i < size; i += dev_bsize, cp += dev_bsize) if (write(fd, cp, (int)dev_bsize) != dev_bsize) { - (void)lseek(fd, offset + i + dev_bsize, 0); + (void)lseek(fd, offset + i + dev_bsize, SEEK_SET); printf(" %ld,", blk + i / dev_bsize); } printf("\n"); |