From 14a73fbc79851419954e1a0224dc2e2849818047 Mon Sep 17 00:00:00 2001 From: CCXXXI Date: Mon, 11 Jan 2021 03:26:57 +0800 Subject: [PATCH] fix syscall tell --- src/userprog/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 7a67c78..1fdf6ea 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -476,8 +476,10 @@ static unsigned tell(int fd) struct open_file *f = get_file_by_fd(fd); lock_acquire(&file_lock); - file_tell(f->file); + int ret = file_tell(f->file); lock_release(&file_lock); + + return ret; } /* Closes file descriptor FD. Exiting or terminating a process implicitly