diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-13 19:12:31 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-17 19:26:07 +0200 |
commit | 94fbd80d7ca8f1451ad98fe9789f2c5b6803992d (patch) | |
tree | 014e4a84a11a3a2e368e2fd332d793a9999547bb | |
parent | f9de37ef2a41d6f48c6be597e829c8df55f04c79 (diff) |
qemu: simplify shutdown
Now that we have the watchdog, killing the watchdog process is another
way of shutting down.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/tests/qemu/init.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tests/qemu/init.c b/src/tests/qemu/init.c index 3d0c9de..ecbbf75 100644 --- a/src/tests/qemu/init.c +++ b/src/tests/qemu/init.c @@ -27,11 +27,9 @@ __attribute__((noreturn)) static void poweroff(void) #if defined(__x86_64__) || defined(__i386__) ioperm(0x604, 2, 1); outw(1U << 13, 0x604); -#else - reboot(RB_POWER_OFF); #endif - sleep(30); - fprintf(stderr, "\x1b[37m\x1b[41m\x1b[1mFailed to power off!!!\x1b[0m\n"); + kill(-1, SIGKILL); + reboot(RB_POWER_OFF); exit(1); } |