diff options
Diffstat (limited to 'src/userprog/syscall.c')
| -rw-r--r-- | src/userprog/syscall.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 3768e79..dc1f067 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -42,7 +42,6 @@ open (const char *filename) struct file *file = filesys_open (filename); if (!file) { - printf ("[%s] open: couldn't find file %s\n", t->name, filename); return -1; } @@ -55,7 +54,6 @@ open (const char *filename) } } free (file); - printf ("[%s] open: unable to find empty file descriptor\n", t->name); return -1; } @@ -75,7 +73,6 @@ get_file (struct thread *thread, int fd_i) struct fd *fd = get_fd (thread, fd_i); if (!fd || !fd->active) { - printf ("[%s] get_file: invalid file descriptor\n", thread->name); return NULL; } @@ -113,7 +110,6 @@ read (int fd_i, void *buf, unsigned size) return i; } else if (fd_i == 1) { // can't read from stdout - printf ("[%s] read: tried to read from stdout\n", thread->name); return -1; } @@ -135,7 +131,7 @@ write (int fd_i, const void *buf, unsigned size) putbuf ((const char *)buf, size); return size; } else if (fd_i == 0) { - printf ("[%s] write: tried to write to stdin\n", thread->name); + // can't write to stdout return -1; } @@ -153,11 +149,7 @@ close (int fd_i) struct thread *thread = thread_current (); struct fd *fd = get_fd (thread, fd_i); - if (!fd) { - return; - } - if (!fd->active) { - printf ("[%s] close: tried to close inactive file descriptor %d\n", thread->name, fd_i); + if (!fd || !fd->active) { return; } |
