summaryrefslogtreecommitdiff
path: root/sysfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysfile.c')
-rw-r--r--sysfile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sysfile.c b/sysfile.c
index ae7d07c..3eec766 100644
--- a/sysfile.c
+++ b/sysfile.c
@@ -18,7 +18,7 @@ argfd(int n, int *pfd, struct file **pf)
if(argint(n, &fd) < 0)
return -1;
- if(fd < 0 || fd >= NOFILE || (f=cp->ofile[fd]) == 0)
+ if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
return -1;
if(pfd)
*pfd = fd;
@@ -35,8 +35,8 @@ fdalloc(struct file *f)
int fd;
for(fd = 0; fd < NOFILE; fd++){
- if(cp->ofile[fd] == 0){
- cp->ofile[fd] = f;
+ if(proc->ofile[fd] == 0){
+ proc->ofile[fd] = f;
return fd;
}
}
@@ -89,7 +89,7 @@ sys_close(void)
if(argfd(0, &fd, &f) < 0)
return -1;
- cp->ofile[fd] = 0;
+ proc->ofile[fd] = 0;
fileclose(f);
return 0;
}
@@ -338,8 +338,8 @@ sys_chdir(void)
return -1;
}
iunlock(ip);
- iput(cp->cwd);
- cp->cwd = ip;
+ iput(proc->cwd);
+ proc->cwd = ip;
return 0;
}
@@ -356,13 +356,13 @@ sys_exec(void)
for(i=0;; i++){
if(i >= NELEM(argv))
return -1;
- if(fetchint(cp, uargv+4*i, (int*)&uarg) < 0)
+ if(fetchint(proc, uargv+4*i, (int*)&uarg) < 0)
return -1;
if(uarg == 0){
argv[i] = 0;
break;
}
- if(fetchstr(cp, uarg, &argv[i]) < 0)
+ if(fetchstr(proc, uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
@@ -382,7 +382,7 @@ sys_pipe(void)
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
- cp->ofile[fd0] = 0;
+ proc->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;