From: 2xsec Date: Tue, 3 Jul 2018 09:23:12 +0000 (+0900) Subject: tests: cleanup reboot.c X-Git-Tag: lxc-3.1.0~221^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=733666f840e8eecc4667db4afb2fa2935844ece7;p=thirdparty%2Flxc.git tests: cleanup reboot.c Signed-off-by: 2xsec --- diff --git a/src/tests/reboot.c b/src/tests/reboot.c index 1f059e0d7..9e9db2277 100644 --- a/src/tests/reboot.c +++ b/src/tests/reboot.c @@ -41,6 +41,7 @@ static int do_reboot(void *arg) if (reboot(*cmd)) printf("failed to reboot(%d): %s\n", *cmd, strerror(errno)); + return 0; } @@ -65,6 +66,7 @@ static int test_reboot(int cmd, int sig) if (!WIFSIGNALED(status)) { if (sig != -1) printf("child process exited but was not signaled\n"); + return -1; } @@ -89,9 +91,11 @@ static int have_reboot_patch(void) fclose(f); if (ret != 1) return 0; + ret = reboot(v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF); if (ret != -1) return 0; + return 1; }