Set exitcodes when killing from the monitor
authorBarret Rhoden <brho@cs.berkeley.edu>
Sat, 21 Jan 2017 17:02:42 +0000 (12:02 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sat, 21 Jan 2017 17:07:06 +0000 (12:07 -0500)
Otherwise, processes that wait will get gibberish, and possibly 0, for
return codes from processes killed from the monitor.  If we had to kill
a process manually, we should return some code.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/monitor.c

index 0fd7b5f..f4a3288 100644 (file)
@@ -411,6 +411,7 @@ int mon_kill(int argc, char **argv, struct hw_trapframe *hw_tf)
                printk("No such proc\n");
                return 1;
        }
+       p->exitcode = 1;        /* typical EXIT_FAILURE */
        proc_destroy(p);
        proc_decref(p);
        return 0;