summaryrefslogtreecommitdiff
path: root/sysfile.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-05-31 09:45:59 -0400
committerRobert Morris <[email protected]>2019-05-31 09:45:59 -0400
commit2ec1959fd1016a18ef3b2d154ce7076be8f237e4 (patch)
tree1aa75252085964283b3a2c735771f4da02346517 /sysfile.c
parent0f90388c893d1924e89e2e4d2187eda0004e9d73 (diff)
downloadxv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.tar.gz
xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.tar.bz2
xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.zip
fork/wait/exit work
Diffstat (limited to 'sysfile.c')
-rw-r--r--sysfile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sysfile.c b/sysfile.c
index d0de779..94f6437 100644
--- a/sysfile.c
+++ b/sysfile.c
@@ -41,11 +41,11 @@ static int
fdalloc(struct file *f)
{
int fd;
- struct proc *curproc = myproc();
+ struct proc *p = myproc();
for(fd = 0; fd < NOFILE; fd++){
- if(curproc->ofile[fd] == 0){
- curproc->ofile[fd] = f;
+ if(p->ofile[fd] == 0){
+ p->ofile[fd] = f;
return fd;
}
}
@@ -374,7 +374,7 @@ sys_chdir(void)
{
char *path;
struct inode *ip;
- struct proc *curproc = myproc();
+ struct proc *p = myproc();
begin_op();
if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
@@ -388,9 +388,9 @@ sys_chdir(void)
return -1;
}
iunlock(ip);
- iput(curproc->cwd);
+ iput(p->cwd);
end_op();
- curproc->cwd = ip;
+ p->cwd = ip;
return 0;
}