diff options
-rw-r--r-- | bin/ksh/shf.c | 4 | ||||
-rw-r--r-- | libexec/uucpd/uucpd.c | 6 | ||||
-rw-r--r-- | sbin/dump/traverse.c | 8 | ||||
-rw-r--r-- | sbin/fsck_ext2fs/utilities.c | 14 | ||||
-rw-r--r-- | sbin/fsck_ffs/utilities.c | 16 | ||||
-rw-r--r-- | sbin/growfs/growfs.c | 6 | ||||
-rw-r--r-- | sbin/modload/a.out.c | 4 | ||||
-rw-r--r-- | sbin/ncheck_ffs/ncheck_ffs.c | 8 | ||||
-rw-r--r-- | sbin/pdisk/file_media.c | 8 |
9 files changed, 37 insertions, 37 deletions
diff --git a/bin/ksh/shf.c b/bin/ksh/shf.c index 31bd0f39a86..1352a2f22aa 100644 --- a/bin/ksh/shf.c +++ b/bin/ksh/shf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shf.c,v 1.14 2005/12/11 18:53:51 deraadt Exp $ */ +/* $OpenBSD: shf.c,v 1.15 2006/04/02 00:48:33 deraadt Exp $ */ /* * Shell file I/O routines @@ -285,7 +285,7 @@ shf_flush(struct shf *shf) if (shf->flags & SHF_READING) { shf->flags &= ~(SHF_EOF | SHF_READING); if (shf->rnleft > 0) { - lseek(shf->fd, (off_t) -shf->rnleft, 1); + lseek(shf->fd, (off_t) -shf->rnleft, SEEK_CUR); shf->rnleft = 0; shf->rp = shf->buf; } diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c index c9400fad567..54bfc33e4ba 100644 --- a/libexec/uucpd/uucpd.c +++ b/libexec/uucpd/uucpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uucpd.c,v 1.30 2005/04/13 02:33:09 deraadt Exp $ */ +/* $OpenBSD: uucpd.c,v 1.31 2006/04/02 00:48:55 deraadt Exp $ */ /* * Copyright (c) 1985 The Regents of the University of California. @@ -40,7 +40,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)uucpd.c 5.10 (Berkeley) 2/26/91";*/ -static char rcsid[] = "$OpenBSD: uucpd.c,v 1.30 2005/04/13 02:33:09 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: uucpd.c,v 1.31 2006/04/02 00:48:55 deraadt Exp $"; #endif /* not lint */ /* @@ -298,7 +298,7 @@ dologin(struct passwd *pw, struct sockaddr *sa) struct lastlog ll; time(&ll.ll_time); - lseek(f, pw->pw_uid * sizeof(struct lastlog), 0); + lseek(f, pw->pw_uid * sizeof(struct lastlog), SEEK_SET); SCPYN(ll.ll_line, hbuf); SCPYN(ll.ll_host, hbuf); (void) write(f, (char *) &ll, sizeof ll); diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 8dcad224be7..6abec7820ef 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traverse.c,v 1.15 2003/08/25 23:28:15 tedu Exp $ */ +/* $OpenBSD: traverse.c,v 1.16 2006/04/02 00:48:35 deraadt Exp $ */ /* $NetBSD: traverse.c,v 1.17 1997/06/05 11:13:27 lukem Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)traverse.c 8.2 (Berkeley) 9/23/93"; #else -static const char rcsid[] = "$OpenBSD: traverse.c,v 1.15 2003/08/25 23:28:15 tedu Exp $"; +static const char rcsid[] = "$OpenBSD: traverse.c,v 1.16 2006/04/02 00:48:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -606,7 +606,7 @@ bread(daddr_t blkno, char *buf, int size) int cnt, i; loop: - if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0) + if (lseek(diskfd, ((off_t)blkno << dev_bshift), SEEK_SET) < 0) msg("bread: lseek fails\n"); if ((cnt = read(diskfd, buf, size)) == size) return; @@ -646,7 +646,7 @@ loop: */ memset(buf, 0, size); for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) { - if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0) + if (lseek(diskfd, ((off_t)blkno << dev_bshift), SEEK_SET) < 0) msg("bread: lseek2 fails!\n"); if ((cnt = read(diskfd, buf, (int)dev_bsize)) == dev_bsize) continue; 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"); diff --git a/sbin/fsck_ffs/utilities.c b/sbin/fsck_ffs/utilities.c index 65e20ee6295..168cb8dab47 100644 --- a/sbin/fsck_ffs/utilities.c +++ b/sbin/fsck_ffs/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.25 2006/03/30 01:16:31 deraadt Exp $ */ +/* $OpenBSD: utilities.c,v 1.26 2006/04/02 00:48:35 deraadt Exp $ */ /* $NetBSD: utilities.c,v 1.18 1996/09/27 22:45:20 christos Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93"; #else -static const char rcsid[] = "$OpenBSD: utilities.c,v 1.25 2006/03/30 01:16:31 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: utilities.c,v 1.26 2006/04/02 00:48:35 deraadt Exp $"; #endif #endif /* not lint */ @@ -305,19 +305,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, @@ -342,19 +342,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"); diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index eb2bf9c548a..3a73344d91f 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: growfs.c,v 1.15 2006/03/31 08:13:07 pedro Exp $ */ +/* $OpenBSD: growfs.c,v 1.16 2006/04/02 00:48:35 deraadt Exp $ */ /* * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. @@ -46,7 +46,7 @@ static const char copyright[] = Copyright (c) 1980, 1989, 1993 The Regents of the University of California.\n\ All rights reserved.\n"; -static const char rcsid[] = "$OpenBSD: growfs.c,v 1.15 2006/03/31 08:13:07 pedro Exp $"; +static const char rcsid[] = "$OpenBSD: growfs.c,v 1.16 2006/04/02 00:48:35 deraadt Exp $"; #endif /* not lint */ /* ********************************************************** INCLUDES ***** */ @@ -1497,7 +1497,7 @@ rdfs(daddr_t bno, size_t size, void *bf, int fsi) DBG_ENTER; - if (lseek(fsi, (off_t)bno * DEV_BSIZE, 0) < 0) { + if (lseek(fsi, (off_t)bno * DEV_BSIZE, SEEK_SET) < 0) { err(33, "rdfs: seek error: %ld", (long)bno); } n = read(fsi, bf, size); diff --git a/sbin/modload/a.out.c b/sbin/modload/a.out.c index b969aea92c0..7fe3325c0c2 100644 --- a/sbin/modload/a.out.c +++ b/sbin/modload/a.out.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a.out.c,v 1.4 2002/12/11 18:28:22 deraadt Exp $ */ +/* $OpenBSD: a.out.c,v 1.5 2006/04/02 00:48:35 deraadt Exp $ */ /* $NetBSD: a.out.c,v 1.1 1999/06/13 12:54:40 mrg Exp $ */ /* @@ -149,7 +149,7 @@ a_out_mod_load(int fd) /* * Seek to the text offset to start loading... */ - if (lseek(fd, N_TXTOFF(sinfo_buf), 0) == -1) + if (lseek(fd, N_TXTOFF(sinfo_buf), SEEK_SET) == -1) err(12, "lseek"); /* diff --git a/sbin/ncheck_ffs/ncheck_ffs.c b/sbin/ncheck_ffs/ncheck_ffs.c index 93ecf017de0..88cc670ef07 100644 --- a/sbin/ncheck_ffs/ncheck_ffs.c +++ b/sbin/ncheck_ffs/ncheck_ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncheck_ffs.c,v 1.25 2005/11/12 15:26:23 deraadt Exp $ */ +/* $OpenBSD: ncheck_ffs.c,v 1.26 2006/04/02 00:48:35 deraadt Exp $ */ /*- * Copyright (c) 1995, 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -26,7 +26,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: ncheck_ffs.c,v 1.25 2005/11/12 15:26:23 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: ncheck_ffs.c,v 1.26 2006/04/02 00:48:35 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -217,7 +217,7 @@ bread(daddr_t blkno, char *buf, int size) int cnt, i; loop: - if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0) + if (lseek(diskfd, ((off_t)blkno << dev_bshift), SEEK_SET) < 0) warnx("bread: lseek fails"); if ((cnt = read(diskfd, buf, size)) == size) return; @@ -248,7 +248,7 @@ loop: */ memset(buf, 0, size); for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) { - if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0) + if (lseek(diskfd, ((off_t)blkno << dev_bshift), SEEK_SET) < 0) warnx("bread: lseek2 fails!"); if ((cnt = read(diskfd, buf, (int)dev_bsize)) == dev_bsize) continue; diff --git a/sbin/pdisk/file_media.c b/sbin/pdisk/file_media.c index 0c235e5a249..126e680af7d 100644 --- a/sbin/pdisk/file_media.c +++ b/sbin/pdisk/file_media.c @@ -179,7 +179,7 @@ compute_block_size(int fd) if (size == 0) { break; } - if ((x = llseek(fd, (loff_t)0, 0)) < 0) { + if ((x = llseek(fd, (loff_t)0, SEEK_SET)) < 0) { error(errno, "Can't seek on file"); break; } @@ -214,7 +214,7 @@ open_file_as_media(char *file, int oflag) if (a != 0) { a->m.kind = file_info.kind; a->m.grain = compute_block_size(fd); - off = llseek(fd, (loff_t)0, 2); /* seek to end of media */ + off = llseek(fd, (loff_t)0, SEEK_END); /* seek to end of media */ #if !defined(__linux__) && !defined(__unix__) if (off <= 0) { off = 1; /* XXX not right? */ @@ -274,7 +274,7 @@ read_file_media(MEDIA m, long long offset, unsigned long count, void *address) } else { /* do the read */ off = offset; - if ((off = llseek(a->fd, off, 0)) >= 0) { + if ((off = llseek(a->fd, off, SEEK_SET)) >= 0) { if ((t = read(a->fd, address, count)) == count) { rtn_value = 1; } else { @@ -311,7 +311,7 @@ write_file_media(MEDIA m, long long offset, unsigned long count, void *address) } else { /* do the write */ off = offset; - if ((off = llseek(a->fd, off, 0)) >= 0) { + if ((off = llseek(a->fd, off, SEEK_SET)) >= 0) { if ((t = write(a->fd, address, count)) == count) { if (off + count > a->m.size_in_bytes) { a->m.size_in_bytes = off + count; |