Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/lseek.c
Show All 25 Lines | |||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* @(#)lseek.c 8.1 (Berkeley) 6/11/93 | * @(#)lseek.c 8.1 (Berkeley) 6/11/93 | ||||
* | * | ||||
imp: This file has a lot of white space changes that makes it a little harder to review.... If… | |||||
* | * | ||||
* Copyright (c) 1989, 1990, 1991 Carnegie Mellon University | * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University | ||||
* All Rights Reserved. | * All Rights Reserved. | ||||
* | * | ||||
* Author: Alessandro Forin | * Author: Alessandro Forin | ||||
* | * | ||||
* Permission to use, copy, modify and distribute this software and its | * Permission to use, copy, modify and distribute this software and its | ||||
* documentation is hereby granted, provided that both the copyright | * documentation is hereby granted, provided that both the copyright | ||||
Show All 20 Lines | |||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "stand.h" | #include "stand.h" | ||||
off_t | off_t | ||||
lseek(int fd, off_t offset, int where) | lseek(int fd, off_t offset, int where) | ||||
{ | { | ||||
off_t bufpos, filepos, target; | off_t bufpos, filepos, target; | ||||
struct open_file *f = &files[fd]; | struct open_file *f; | ||||
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) { | f = fd2open_file(fd); | ||||
if (f == NULL || f->f_flags == 0) { | |||||
errno = EBADF; | errno = EBADF; | ||||
return (-1); | return (-1); | ||||
} | } | ||||
if (f->f_flags & F_RAW) { | if (f->f_flags & F_RAW) { | ||||
/* | /* | ||||
* On RAW devices, update internal offset. | * On RAW devices, update internal offset. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
This file has a lot of white space changes that makes it a little harder to review.... If possible, can you split the changes between functional and whitespace?