projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Move problem 1-2 (join) into project 2 as the "wait" system call.
[pintos-anon]
/
src
/
tests
/
userprog
/
shell.c
diff --git
a/src/tests/userprog/shell.c
b/src/tests/userprog/shell.c
index 905e18b0275570ce2f678cc9d87b8f72ee84bc03..7cf5c607d7d431df8d6ad7cc517a27be910c3fcc 100644
(file)
--- a/
src/tests/userprog/shell.c
+++ b/
src/tests/userprog/shell.c
@@
-23,6
+23,12
@@
main (void)
/* Execute command. */
if (cp > command)
- join (exec (command));
+ {
+ pid_t pid = exec (command);
+ if (pid != PID_ERROR)
+ wait (pid);
+ else
+ printf ("exec failed\n");
+ }
}
}