diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-09 06:41:09 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-09 06:41:09 +0000 |
commit | 1aa0747669263b04b60edba9f552c916bc818e6f (patch) | |
tree | 19592e3151aa0121940b31c051b48be89c161376 | |
parent | 43a8f434a03f0a6a7af3f51de43614730925bb9e (diff) |
Fix casts to off_t, problem noted and fixed by Theo.
-rw-r--r-- | sbin/fsirand/fsirand.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c index e102f2c5433..d89b871ba20 100644 --- a/sbin/fsirand/fsirand.c +++ b/sbin/fsirand/fsirand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsirand.c,v 1.5 1997/02/09 01:10:17 millert Exp $ */ +/* $OpenBSD: fsirand.c,v 1.6 1997/02/09 06:41:08 millert Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: fsirand.c,v 1.5 1997/02/09 01:10:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: fsirand.c,v 1.6 1997/02/09 06:41:08 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -162,8 +162,8 @@ fsirand(device) sblock = (struct fs *)&sbuftmp; for (cg = 0; cg < sblock->fs_ncg; cg++) { dblk = fsbtodb(sblock, cgsblock(sblock, cg)); - if (lseek(devfd, (off_t)(dblk * bsize), SEEK_SET) < 0) { - warn("Can't seek to %qd", (off_t)(dblk * bsize)); + if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { + warn("Can't seek to %qd", (off_t)dblk * bsize); return (1); } else if ((n = write(devfd, (void *)sblock, SBSIZE)) != SBSIZE) { warn("Can't read backup superblock %d on %s: %s", @@ -226,8 +226,8 @@ fsirand(device) /* Update superblock if appropriate */ if ((sblock->fs_inodefmt >= FS_44INODEFMT) && !printonly) { dblk = fsbtodb(sblock, cgsblock(sblock, cg)); - if (lseek(devfd, (off_t)(dblk * bsize), SEEK_SET) < 0) { - warn("Can't seek to %qd", (off_t)(dblk * bsize)); + if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { + warn("Can't seek to %qd", (off_t)dblk * bsize); return (1); } else if ((n = write(devfd, (void *)sblock, SBSIZE)) != SBSIZE) { warn("Can't read backup superblock %d on %s: %s", @@ -240,8 +240,8 @@ fsirand(device) /* Read in inodes, then print or randomize generation nums */ dblk = fsbtodb(sblock, ino_to_fsba(sblock, inumber)); - if (lseek(devfd, (off_t)(dblk * bsize), SEEK_SET) < 0) { - warn("Can't seek to %qd", (off_t)(dblk * bsize)); + if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { + warn("Can't seek to %qd", (off_t)dblk * bsize); return (1); } else if ((n = read(devfd, inodebuf, ibufsize)) != ibufsize) { warnx("Can't read inodes: %s", @@ -261,9 +261,9 @@ fsirand(device) /* Write out modified inodes */ if (!printonly) { - if (lseek(devfd, (off_t)(dblk * bsize), SEEK_SET) < 0) { + if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) { warn("Can't seek to %qd", - (off_t)(dblk * bsize)); + (off_t)dblk * bsize); return (1); } else if ((n = write(devfd, inodebuf, ibufsize)) != ibufsize) { |