# HG changeset patch # User Markus Brökers # Date 1282064277 -7200 # Node ID cb1d3f4cf18e96b52a2425e89a713330d5aa0b75 # Parent dff18d1ac2af614d4d91ea85f73017437bd89770 execve returns a value on error and this catches it diff --git a/fork.c b/fork.c --- a/fork.c +++ b/fork.c @@ -18,7 +18,8 @@ switch (pid) { case 0: printf ("Starting new Process\n"); - return execve (cmd, argv, argp); + execve (cmd, argv, argp); + exit (EXIT_FAILURE); case -1: perror ("FORK"); return errno; diff --git a/mem2swap.c b/mem2swap.c --- a/mem2swap.c +++ b/mem2swap.c @@ -78,6 +78,7 @@ switch (pid) { case 0: execve (CMD_FREE, args, NULL); + exit (EXIT_FAILURE); case -1: perror ("Fork Error"); return EXIT_FAILURE;