summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-07-27 20:09:13 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-07-27 20:09:13 +0000
commitcf7742997a4eeb2aca2f91ab8fa23c3075b167a6 (patch)
treeff4864a8675f48e6f9e563d453a6ceea7ae0ef6c /sys/kern/vfs_syscalls.c
parent3ab6b09c53c62061540f72172e9ee5056bb10769 (diff)
downloadsrc-test2-cf7742997a4eeb2aca2f91ab8fa23c3075b167a6.tar.gz
src-test2-cf7742997a4eeb2aca2f91ab8fa23c3075b167a6.zip
Notes
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 7aa17297dd98..f04664fda8de 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -685,8 +685,20 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
* the descriptor while we are blocked in vn_open()
*/
fhold(fp);
- error = vn_open(&nd, &flags, cmode, -1);
+ error = vn_open(&nd, &flags, cmode, indx);
if (error) {
+
+ /*
+ * If the vn_open replaced the method vector, something
+ * wonderous happened deep below and we just pass it up
+ * pretending we know what we do.
+ */
+ if (error == ENXIO && fp->f_ops != &badfileops) {
+ fdrop(fp, td);
+ td->td_retval[0] = indx;
+ return (0);
+ }
+
/*
* release our own reference
*/