Add EXIT_FAILURE, EXIT_SUCCESS to syscall.h,
[pintos-anon] / src / examples / shell.c
index d31eb3a9a67c534199f0731165295e0a117b1b7e..916d25267ac758a198fb4d299af7fa54edf5bfd4 100644 (file)
@@ -21,6 +21,11 @@ main (void)
       /* Execute command. */
       if (!strcmp (command, "exit"))
         break;
+      else if (!memcmp (command, "cd ", 3)) 
+        {
+          if (!chdir (command + 3))
+            printf ("\"%s\": chdir failed\n", command + 3);
+        }
       else if (command[0] == '\0') 
         {
           /* Empty command. */
@@ -36,7 +41,7 @@ main (void)
     }
 
   printf ("Shell exiting.");
-  return 0;
+  return EXIT_SUCCESS;
 }
 
 /* Reads a line of input from the user into LINE, which has room