aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tests/qemu/init.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-13 19:12:31 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-17 19:26:07 +0200
commit7b566834809c64aba0593162db9a127fb4029c27 (patch)
treee7534f7175e56881e610b91d95d6d9ed9567e9da /src/tests/qemu/init.c
parentqemu: add more debugging options to main makefile (diff)
downloadwireguard-monolithic-historical-7b566834809c64aba0593162db9a127fb4029c27.tar.xz
wireguard-monolithic-historical-7b566834809c64aba0593162db9a127fb4029c27.zip
qemu: simplify shutdown
Now that we have the watchdog, killing the watchdog process is another way of shutting down.
Diffstat (limited to 'src/tests/qemu/init.c')
-rw-r--r--src/tests/qemu/init.c6
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);
}