From 116d655640339e0b46dac6059b168ef73ca000a8 Mon Sep 17 00:00:00 2001 From: kleink Date: Wed, 9 Apr 1997 23:26:06 +0000 Subject: [PATCH] Back out POSIX.1 conformance change to lseek(2); this will be attended to in a different way. --- sys/kern/vfs_syscalls.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 77ced01e4c60..5abbc359b11f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.82 1997/04/07 00:04:16 kleink Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.83 1997/04/09 23:26:06 kleink Exp $ */ /* * Copyright (c) 1989, 1993 @@ -1124,7 +1124,6 @@ sys_lseek(p, v, retval) register struct filedesc *fdp = p->p_fd; register struct file *fp; struct vattr vattr; - register off_t newoff; int error; if ((u_int)SCARG(uap, fd) >= fdp->fd_nfiles || @@ -1138,25 +1137,22 @@ sys_lseek(p, v, retval) return (ESPIPE); switch (SCARG(uap, whence)) { case L_INCR: - newoff = fp->f_offset + SCARG(uap, offset); + fp->f_offset += SCARG(uap, offset); break; case L_XTND: error = VOP_GETATTR((struct vnode *)fp->f_data, &vattr, cred, p); if (error) return (error); - newoff = SCARG(uap, offset) + vattr.va_size; + fp->f_offset = SCARG(uap, offset) + vattr.va_size; break; case L_SET: - newoff = SCARG(uap, offset); + fp->f_offset = SCARG(uap, offset); break; default: return (EINVAL); } - if (newoff < 0) - return (EINVAL); - - *(off_t *)retval = fp->f_offset = newoff; + *(off_t *)retval = fp->f_offset; return (0); }