summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2000-06-12 18:06:12 +0000
committeralfred <alfred@FreeBSD.org>2000-06-12 18:06:12 +0000
commite7947cbed1b066a08b637ca36044e167837192b2 (patch)
tree523fd8746df1fd353eb3cb39b7cd644d826fc0c3 /sys/kern/uipc_syscalls.c
parent6c90966cad8960204e970e220ce11ccd81994f46 (diff)
downloadFreeBSD-src-e7947cbed1b066a08b637ca36044e167837192b2.zip
FreeBSD-src-e7947cbed1b066a08b637ca36044e167837192b2.tar.gz
unstatic getfp() so that other subsystems can use it.
make sendfile() use it. Approved by: dg
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 298bbe1..480b8dc 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1432,9 +1432,8 @@ sendfile(struct proc *p, struct sendfile_args *uap)
* Do argument checking. Must be a regular file in, stream
* type and connected socket out, positive offset.
*/
- if (((u_int)uap->fd) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[uap->fd]) == NULL ||
- (fp->f_flag & FREAD) == 0) {
+ fp = getfp(fdp, uap->fd, FREAD);
+ if (fp == NULL) {
error = EBADF;
goto done;
}
OpenPOWER on IntegriCloud