]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tests: cleanup reboot.c
author2xsec <dh48.jeong@samsung.com>
Tue, 3 Jul 2018 09:23:12 +0000 (18:23 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 3 Jul 2018 10:44:45 +0000 (12:44 +0200)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/tests/reboot.c

index 1f059e0d782c1c7eb81e77886b9573cef49cc9b8..9e9db2277e5dac1295fd3779c75931c270f9c8cc 100644 (file)
@@ -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;
 }