diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-02-12 14:49:37 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-02-12 15:26:44 +0100 |
| commit | d83fcc30717f4e687c78bbc7896244643a2e8e4d (patch) | |
| tree | 70fe8c0f25a82f8790d8449b7467ac927fa760b3 /src | |
| parent | fcfef25ad1ac31268d7119c56c819467adf9424e (diff) | |
| download | pintos-d83fcc30717f4e687c78bbc7896244643a2e8e4d.tar.gz | |
remove some prints
Diffstat (limited to 'src')
| -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; } |
