From 7ab8e74f1331b70dd52e604d0010a49fabf9e549 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 8 Feb 2015 01:54:12 +0100 Subject: boot: restore terminal state on exit * boot/boot.c (host_exit): Make it a function and restore the terminal state. --- boot/boot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'boot/boot.c') diff --git a/boot/boot.c b/boot/boot.c index 69c30333..ab9c1648 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -90,7 +90,13 @@ restore_termstate () #define host_fstat fstat typedef struct stat host_stat_t; -#define host_exit exit + +void __attribute__ ((__noreturn__)) +host_exit (int status) +{ + restore_termstate (); + exit (status); +} mach_port_t privileged_host_port, master_device_port; mach_port_t pseudo_master_device_port; -- cgit v1.2.3