summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-05 15:27:32 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-05 15:28:02 +0100
commit8772b00d3ad7bb74abf69ba72d71c52e4656f545 (patch)
tree81eb084c32e4530013c550058688e620b1bfb160 /src
parenta547e04ea89ab4bd0b35647a22ee90c0b0d39c4c (diff)
qemu: move marker to top and flush
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/tests/qemu/init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/qemu/init.c b/src/tests/qemu/init.c
index 5185a4e..a8a4a4b 100644
--- a/src/tests/qemu/init.c
+++ b/src/tests/qemu/init.c
@@ -20,6 +20,8 @@
__attribute__((noreturn)) static void poweroff(void)
{
+ fflush(stdout);
+ fflush(stderr);
ioperm(0x604, 2, 1);
outw(1 << 13, 0x604);
sleep(30);
@@ -38,7 +40,6 @@ static void panic(const char *what)
static void print_banner(const struct utsname *utsname)
{
int len = strlen(" WireGuard Test Suite on ") + strlen(utsname->sysname) + strlen(utsname->release);
- putchar('\0');putchar('\0');putchar('\0');putchar('\0');putchar('\n');
printf("\x1b[45m\x1b[33m\x1b[1m%*.s\x1b[0m\n\x1b[45m\x1b[33m\x1b[1m WireGuard Test Suite on %s %s \x1b[0m\n\x1b[45m\x1b[33m\x1b[1m%*.s\x1b[0m\n\n", len, "", utsname->sysname, utsname->release, len, "");
}
@@ -169,8 +170,7 @@ int main(int argc, char *argv[])
{
struct utsname utsname;
- /* Work around nasty QEMU/kernel race condition. */
- if (write(1, NULL, 0) < 0)
+ if (write(1, "\0\0\0\0\n", 5) < 0)
reboot(RB_AUTOBOOT);
if (uname(&utsname) < 0)