summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-08-30 18:55:06 +0000
committerrtm <rtm>2006-08-30 18:55:06 +0000
commit2aa4c3bc29b67dcc4810aca96fd0ae8aa7c32b5e (patch)
tree63446e3d197769ba44a9e32a30a284327ec93af8 /syscall.c
parent18432ed5edaeb2a6ffd91f557880c277d96784c1 (diff)
downloadxv6-labs-2aa4c3bc29b67dcc4810aca96fd0ae8aa7c32b5e.tar.gz
xv6-labs-2aa4c3bc29b67dcc4810aca96fd0ae8aa7c32b5e.tar.bz2
xv6-labs-2aa4c3bc29b67dcc4810aca96fd0ae8aa7c32b5e.zip
complain if no disk 1
lots of cleanup
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/syscall.c b/syscall.c
index 2918bb0..2d08a0e 100644
--- a/syscall.c
+++ b/syscall.c
@@ -21,8 +21,6 @@
* Arguments on the stack, from the user call to the C
* library system call function. The saved user %esp points
* to a saved program counter, and then the first argument.
- *
- * Return value? Error indication? Errno?
*/
/*
@@ -51,7 +49,6 @@ fetchbyte(struct proc *p, uint addr, char* c)
return 0;
}
-// This arg is void* so that both int* and uint* can be passed.
int
fetcharg(int argno, void *ip)
{
@@ -366,9 +363,6 @@ sys_chdir(void)
if((l = checkstring(arg0)) < 0)
return -1;
- if(l >= DIRSIZ)
- return -1;
-
if ((ip = namei(cp->mem + arg0, NAMEI_LOOKUP, 0, 0, 0)) == 0)
return -1;
@@ -436,11 +430,8 @@ sys_dup(void)
return -1;
if(cp->fds[fd] == 0)
return -1;
- if (cp->fds[fd]->type != FD_PIPE && cp->fds[fd]->type != FD_FILE)
+ if ((ufd1 = fd_ualloc()) < 0)
return -1;
- if ((ufd1 = fd_ualloc()) < 0) {
- return -1;
- }
cp->fds[ufd1] = cp->fds[fd];
fd_incref(cp->fds[ufd1]);
return ufd1;