fork.c
changeset 138 dff18d1ac2af
parent 77 49e0babccb23
child 139 cb1d3f4cf18e
--- a/fork.c
+++ b/fork.c
@@ -18,7 +18,7 @@
     switch (pid) {
     case 0:
         printf ("Starting new Process\n");
-        execve (cmd, argv, argp);
+        return execve (cmd, argv, argp);
     case -1:
         perror ("FORK");
         return errno;
@@ -26,8 +26,12 @@
         printf ("Pid started as %d\n", pid);
         wait (&pid);
         printf ("Exit-Status = %d\n", pid);
+
         return pid;
     }
+
+    // should never happen
+    return -1;
 }
 
 int main (int argc, char **argv)