diff --git a/sys/kernel/descrip.c b/sys/kernel/descrip.c index de8cb73..101bdc8 100644 --- a/sys/kernel/descrip.c +++ b/sys/kernel/descrip.c @@ -321,7 +321,7 @@ } else if (td->o_files[to] != 0x0) { kprintf("FD IN USE!"); - return (-1); + //return (-1); } td->o_files[to] = td->o_files[from]; diff --git a/sys/kernel/vfs_calls.c b/sys/kernel/vfs_calls.c index 2afc81f..df153f0 100644 --- a/sys/kernel/vfs_calls.c +++ b/sys/kernel/vfs_calls.c @@ -304,7 +304,7 @@ kfree(buffer); td->td_retval[0] = uap->nbyte; } - else if (uap->fd == 1) { + else if (uap->fd == 1 && td->o_files[1]->fd != 0x0) { buffer = kmalloc(1024); memcpy(buffer, uap->buf, uap->nbyte); kprintf(buffer);