projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
When printing a directory tree, indicate explicitly if it's empty.
[pintos-anon]
/
solutions
/
p2.patch
diff --git
a/solutions/p2.patch
b/solutions/p2.patch
index 3b2de25db568f5e6f05e09e73fae1a3d6e97d96a..0940c141ee2d9b97c4c898cf3e8c2c57d1110041 100644
(file)
--- a/
solutions/p2.patch
+++ b/
solutions/p2.patch
@@
-493,7
+493,7
@@
Index: src/userprog/syscall.c
diff -u src/userprog/syscall.c~ src/userprog/syscall.c
--- src/userprog/syscall.c~
+++ src/userprog/syscall.c
diff -u src/userprog/syscall.c~ src/userprog/syscall.c
--- src/userprog/syscall.c~
+++ src/userprog/syscall.c
-@@ -1,20 +1,48
3
@@
+@@ -1,20 +1,48
6
@@
#include "userprog/syscall.h"
#include <stdio.h>
+#include <string.h>
#include "userprog/syscall.h"
#include <stdio.h>
+#include <string.h>
@@
-657,7
+657,10
@@
diff -u src/userprog/syscall.c~ src/userprog/syscall.c
+ for (length = 0; length < PGSIZE; length++)
+ {
+ if (us >= (char *) PHYS_BASE || !get_user (ks + length, us++))
+ for (length = 0; length < PGSIZE; length++)
+ {
+ if (us >= (char *) PHYS_BASE || !get_user (ks + length, us++))
-+ thread_exit ();
++ {
++ palloc_free_page (ks);
++ thread_exit ();
++ }
+
+ if (ks[length] == '\0')
+ return ks;
+
+ if (ks[length] == '\0')
+ return ks;