summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1997-09-15 08:25:43 +0000
committerphk <phk@FreeBSD.org>1997-09-15 08:25:43 +0000
commit950d92dde613ce4946a4ac5feedf9fc617a50605 (patch)
treeffae44de59944a2b8714a5c3be269fa348081bca /sys/kern
parent6df69d408651b922a4da25ee1c130216e152cd70 (diff)
downloadFreeBSD-src-950d92dde613ce4946a4ac5feedf9fc617a50605.zip
FreeBSD-src-950d92dde613ce4946a4ac5feedf9fc617a50605.tar.gz
Deal more correctly with mountpoints.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_extattr.c8
-rw-r--r--sys/kern/vfs_syscalls.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 93e0a46..01b980d 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.67 1997/09/02 20:06:03 bde Exp $
+ * $Id: vfs_syscalls.c,v 1.68 1997/09/14 16:51:15 phk Exp $
*/
/*
@@ -2783,12 +2783,12 @@ __getcwd(p, uap, retval)
for (vp = fdp->fd_cdir; vp != fdp->fd_rdir && vp != rootvnode;) {
if (vp->v_dd->v_id != vp->v_ddid)
- return(ENOENT);
+ return(ENOTDIR);
ncp = TAILQ_FIRST(&vp->v_cache_dst);
if (!ncp)
return(ENOENT);
if (ncp->nc_dvp != vp->v_dd)
- return(ENOENT);
+ return(EBADF);
for (i=ncp->nc_nlen-1; i >= 0; i--) {
if (uap->buflen-- < 2)
return(ENOMEM);
@@ -2801,6 +2801,8 @@ __getcwd(p, uap, retval)
uap->buf++;
j++;
vp = vp->v_dd;
+ if (vp->v_flag & VROOT)
+ vp = vp->v_mount->mnt_vnodecovered;
}
if (!j) {
if (uap->buflen-- < 2)
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 93e0a46..01b980d 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.67 1997/09/02 20:06:03 bde Exp $
+ * $Id: vfs_syscalls.c,v 1.68 1997/09/14 16:51:15 phk Exp $
*/
/*
@@ -2783,12 +2783,12 @@ __getcwd(p, uap, retval)
for (vp = fdp->fd_cdir; vp != fdp->fd_rdir && vp != rootvnode;) {
if (vp->v_dd->v_id != vp->v_ddid)
- return(ENOENT);
+ return(ENOTDIR);
ncp = TAILQ_FIRST(&vp->v_cache_dst);
if (!ncp)
return(ENOENT);
if (ncp->nc_dvp != vp->v_dd)
- return(ENOENT);
+ return(EBADF);
for (i=ncp->nc_nlen-1; i >= 0; i--) {
if (uap->buflen-- < 2)
return(ENOMEM);
@@ -2801,6 +2801,8 @@ __getcwd(p, uap, retval)
uap->buf++;
j++;
vp = vp->v_dd;
+ if (vp->v_flag & VROOT)
+ vp = vp->v_mount->mnt_vnodecovered;
}
if (!j) {
if (uap->buflen-- < 2)
OpenPOWER on IntegriCloud