fix up inconsisten uses of lseek(). (three uses. one hard-coded 'whence'

as a number, one used an L_ constant and the other used a SEEK_ constant!)
This commit is contained in:
cgd 1995-03-04 06:10:39 +00:00
parent ee38224d2e
commit 4c02b41140
2 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mkfs.c 8.3 (Berkeley) 2/3/94";*/
static char *rcsid = "$Id: mkfs.c,v 1.15 1994/12/18 16:00:21 cgd Exp $";
static char *rcsid = "$Id: mkfs.c,v 1.16 1995/03/04 06:10:39 cgd Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -1094,7 +1094,7 @@ rdfs(bno, size, bf)
memcpy(bf, membase + bno * sectorsize, size);
return;
}
if (lseek(fsi, (off_t)bno * sectorsize, 0) < 0) {
if (lseek(fsi, (off_t)bno * sectorsize, SEEK_SET) < 0) {
printf("seek error: %ld\n", bno);
perror("rdfs");
exit(33);

View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)newfs.c 8.8 (Berkeley) 4/18/94";*/
static char *rcsid = "$Id: newfs.c,v 1.15 1995/01/30 19:42:22 mycroft Exp $";
static char *rcsid = "$Id: newfs.c,v 1.16 1995/03/04 06:11:13 cgd Exp $";
#endif /* not lint */
/*
@ -625,7 +625,7 @@ rewritelabel(s, fd, lp)
alt = lp->d_ncylinders * lp->d_secpercyl - lp->d_nsectors;
for (i = 1; i < 11 && i < lp->d_nsectors; i += 2) {
if (lseek(cfd, (off_t)(alt + i) * lp->d_secsize,
L_SET) == -1)
SEEK_SET) == -1)
fatal("lseek to badsector area: %s",
strerror(errno));
if (write(cfd, blk, lp->d_secsize) < lp->d_secsize)