diff options
author | kaashoek <kaashoek> | 2006-08-19 23:41:34 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-08-19 23:41:34 +0000 |
commit | 8787cd01dfa6080d219f3dd7bbf03f3eb988a74e (patch) | |
tree | 7b1d86071a74d01013995508be4c5a267d0f23e2 /fs.c | |
parent | ceb0e427962d0656e672955585c04093b9efda90 (diff) | |
download | xv6-labs-8787cd01dfa6080d219f3dd7bbf03f3eb988a74e.tar.gz xv6-labs-8787cd01dfa6080d219f3dd7bbf03f3eb988a74e.tar.bz2 xv6-labs-8787cd01dfa6080d219f3dd7bbf03f3eb988a74e.zip |
chdir
cd in shell
nits in mkdir, ls, etc.
Diffstat (limited to 'fs.c')
-rw-r--r-- | fs.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -385,6 +385,7 @@ struct inode * namei(char *path, int mode, uint *ret_off) { struct inode *dp; + struct proc *p = curproc[cpu()]; char *cp = path, *cp1; uint off, dev; struct buf *bp; @@ -392,7 +393,12 @@ namei(char *path, int mode, uint *ret_off) int i, atend; unsigned ninum; - dp = iget(rootdev, 1); + if (*cp == '/') dp = iget(rootdev, 1); + else { + dp = p->cwd; + iincref(dp); + ilock(dp); + } while(*cp == '/') cp++; |