diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index 10f6de1..cdadb2b 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -205,7 +205,7 @@ static void exit(int status) while (!list_empty(&self->files)) { - struct open_file *f = list_entry(list_pop_back(&self->files), + struct open_file *f = list_entry(list_back(&self->files), struct open_file, elem); close(f->fd); }