Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Duh, use fd_getfile() in sys_close().
details: https://anonhg.NetBSD.org/src/rev/4ee0311f7f5e
branches: trunk
changeset: 511985:4ee0311f7f5e
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sun Jul 01 18:12:00 2001 +0000
description:
Duh, use fd_getfile() in sys_close().
diffstat:
sys/kern/kern_descrip.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r bf851197de6e -r 4ee0311f7f5e sys/kern/kern_descrip.c
--- a/sys/kern/kern_descrip.c Sun Jul 01 18:07:33 2001 +0000
+++ b/sys/kern/kern_descrip.c Sun Jul 01 18:12:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_descrip.c,v 1.78 2001/06/16 08:28:39 jdolecek Exp $ */
+/* $NetBSD: kern_descrip.c,v 1.79 2001/07/01 18:12:00 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -497,11 +497,14 @@
} */ *uap = v;
int fd;
struct filedesc *fdp;
+ struct file *fp;
fd = SCARG(uap, fd);
fdp = p->p_fd;
- if ((u_int)fd >= fdp->fd_nfiles)
+
+ if ((fp = fd_getfile(fdp, fd)) == NULL)
return (EBADF);
+
return (fdrelease(p, fd));
}
Home |
Main Index |
Thread Index |
Old Index