diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-04-02 00:51:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-04-02 00:51:38 +0000 |
commit | 979a4130198cf695fa53864ef389566d313a5a9f (patch) | |
tree | 4d4b0f2c212e23704f4f0144397cca1f4eba18ef | |
parent | b4f316147600b29b68c7b4a1440753be2e4d4d85 (diff) |
use SEEK_* for lseek()
-rw-r--r-- | usr.bin/mail/fio.c | 6 | ||||
-rw-r--r-- | usr.sbin/edquota/edquota.c | 4 | ||||
-rw-r--r-- | usr.sbin/fdformat/fdformat.c | 4 | ||||
-rw-r--r-- | usr.sbin/quot/quot.c | 8 | ||||
-rw-r--r-- | usr.sbin/rarpd/rarpd.c | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index bb03ebc6e1f..6aaed2d0bb5 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fio.c,v 1.25 2004/05/10 15:25:51 deraadt Exp $ */ +/* $OpenBSD: fio.c,v 1.26 2006/04/02 00:51:37 deraadt Exp $ */ /* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static const char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95"; #else -static const char rcsid[] = "$OpenBSD: fio.c,v 1.25 2004/05/10 15:25:51 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: fio.c,v 1.26 2006/04/02 00:51:37 deraadt Exp $"; #endif #endif /* not lint */ @@ -292,7 +292,7 @@ makemessage(FILE *f, int omsgCount) message = nmessage; size -= (omsgCount + 1) * sizeof(struct message); fflush(f); - (void)lseek(fileno(f), (off_t)sizeof(*message), 0); + (void)lseek(fileno(f), (off_t)sizeof(*message), SEEK_SET); if (myread(fileno(f), (void *) &message[omsgCount], size) != size) errx(1, "Message temporary file corrupted"); message[msgCount].m_size = 0; diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index 255164380a4..1569cef43af 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -38,7 +38,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: edquota.c,v 1.43 2005/11/12 15:26:23 deraadt Exp $"; +static char *rcsid = "$Id: edquota.c,v 1.44 2006/04/02 00:50:40 deraadt Exp $"; #endif /* not lint */ /* @@ -333,7 +333,7 @@ putprivs(long id, int quotatype, struct quotause *quplist) if ((fd = open(qup->qfname, O_WRONLY)) < 0) { perror(qup->qfname); } else { - lseek(fd, (off_t)(id * sizeof (struct dqblk)), 0); + lseek(fd, (off_t)(id * sizeof (struct dqblk)), SEEK_SET); if (write(fd, &qup->dqblk, sizeof (struct dqblk)) != sizeof (struct dqblk)) warn("%s", qup->qfname); diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c index c1ba5328c85..748b21d4a39 100644 --- a/usr.sbin/fdformat/fdformat.c +++ b/usr.sbin/fdformat/fdformat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdformat.c,v 1.13 2006/03/12 02:45:45 deraadt Exp $ */ +/* $OpenBSD: fdformat.c,v 1.14 2006/04/02 00:50:42 deraadt Exp $ */ /* * Copyright (C) 1992-1994 by Joerg Wunsch, Dresden @@ -118,7 +118,7 @@ verify_track(int fd, int track, int tracksize) fprintf (stderr, "\nfdformat: out of memory\n"); exit (2); } - if (lseek (fd, (off_t) track*tracksize, 0) < 0) + if (lseek (fd, (off_t) track*tracksize, SEEK_SET) < 0) rv = -1; /* try twice reading it, without using the normal retrier */ else if (read (fd, buf, tracksize) != tracksize diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index 3641ce0ac4c..ade893d3151 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quot.c,v 1.14 2003/08/25 23:28:16 tedu Exp $ */ +/* $OpenBSD: quot.c,v 1.15 2006/04/02 00:50:42 deraadt Exp $ */ /* $NetBSD: quot.c,v 1.7.4.1 1996/05/31 18:06:36 jtc Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: quot.c,v 1.14 2003/08/25 23:28:16 tedu Exp $"; +static char rcsid[] = "$Id: quot.c,v 1.15 2006/04/02 00:50:42 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -100,7 +100,7 @@ get_inode(int fd, struct fs *super, ino_t ino) last = (ino / INOCNT(super)) * INOCNT(super); if (lseek(fd, (off_t)ino_to_fsba(super, last) << super->fs_fshift, - 0) < 0 + SEEK_SET) < 0 || read(fd, ip, INOSZ(super)) != INOSZ(super)) { err(1, "read inodes"); } @@ -523,7 +523,7 @@ quot(char *name, char *mp) warn("%s", name); return; } - if (lseek(fd, SBOFF, 0) != SBOFF + if (lseek(fd, SBOFF, SEEK_SET) != SBOFF || read(fd, superblock, SBSIZE) != SBSIZE || ((struct fs *)superblock)->fs_magic != FS_MAGIC || ((struct fs *)superblock)->fs_bsize > MAXBSIZE diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c index 9b9015be016..39376638d21 100644 --- a/usr.sbin/rarpd/rarpd.c +++ b/usr.sbin/rarpd/rarpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rarpd.c,v 1.46 2006/01/23 17:29:22 millert Exp $ */ +/* $OpenBSD: rarpd.c,v 1.47 2006/04/02 00:50:42 deraadt Exp $ */ /* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */ /* @@ -28,7 +28,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char rcsid[] = "$OpenBSD: rarpd.c,v 1.46 2006/01/23 17:29:22 millert Exp $"; +static char rcsid[] = "$OpenBSD: rarpd.c,v 1.47 2006/04/02 00:50:42 deraadt Exp $"; #endif @@ -451,7 +451,7 @@ rarp_loop(void) if (cc < 0) { if (errno == EINVAL && (lseek(fd, (off_t)0, SEEK_CUR) + bufsize) < 0) { - (void) lseek(fd, (off_t)0, 0); + (void) lseek(fd, (off_t)0, SEEK_SET); goto again; } error(FATAL, "read: %s", strerror(errno)); |