diff --git a/console.c b/console.c index 7e357fb..206a380 100644 --- a/console.c +++ b/console.c @@ -163,8 +163,6 @@ console_write (int minor, void *buf, int n) int i; uchar *b = buf; - cprintf ("print character to console\n"); - for (i = 0; i < n; i++) { cons_putc((int) b[i]); } diff --git a/syscall.c b/syscall.c index f0f2cc2..ba3b25f 100644 --- a/syscall.c +++ b/syscall.c @@ -263,6 +263,7 @@ sys_open(void) iput(ip); return -1; } + if((ufd = fd_ualloc()) < 0){ iput(ip); fd_close(fd); @@ -467,14 +468,6 @@ sys_block(void) brelse(b); } -#if 0 - cprintf("overwrite fs.img!\n"); - b = getblk(); - memset (b->data, 'f', 10); - bwrite(1, b, 0); - cprintf("write is done\n"); -#endif - ip = iget(1, 1); cprintf("iget 1: %d %d %d %d %d %d %d %d\n", ip->dev, ip->inum, ip->count, ip->busy, diff --git a/userfs.c b/userfs.c index dcdffbb..e6dd172 100644 --- a/userfs.c +++ b/userfs.c @@ -23,7 +23,6 @@ main(void) fd = open("console", 1); if(fd >= 0){ puts("open console ok\n"); - close(fd); } else { puts("open console failed!\n"); }