X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Ftests%2Fuserprog%2Fshell.c;h=7b9570ac9d564df88b3aef8c71d14600b1a481e6;hb=6d03839032f21bda2358cfef83ba2412651e6588;hp=905e18b0275570ce2f678cc9d87b8f72ee84bc03;hpb=d46fd132092304422193b717d9a60641604cc1b5;p=pintos-anon diff --git a/src/tests/userprog/shell.c b/src/tests/userprog/shell.c index 905e18b..7b9570a 100644 --- 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) + join (pid); + else + printf ("exec failed\n"); + } } }