Unverified Commit 733666f8 by 2xsec

tests: cleanup reboot.c

Signed-off-by: 's avatar2xsec <dh48.jeong@samsung.com>
parent fe142896
...@@ -41,6 +41,7 @@ static int do_reboot(void *arg) ...@@ -41,6 +41,7 @@ static int do_reboot(void *arg)
if (reboot(*cmd)) if (reboot(*cmd))
printf("failed to reboot(%d): %s\n", *cmd, strerror(errno)); printf("failed to reboot(%d): %s\n", *cmd, strerror(errno));
return 0; return 0;
} }
...@@ -65,6 +66,7 @@ static int test_reboot(int cmd, int sig) ...@@ -65,6 +66,7 @@ static int test_reboot(int cmd, int sig)
if (!WIFSIGNALED(status)) { if (!WIFSIGNALED(status)) {
if (sig != -1) if (sig != -1)
printf("child process exited but was not signaled\n"); printf("child process exited but was not signaled\n");
return -1; return -1;
} }
...@@ -89,9 +91,11 @@ static int have_reboot_patch(void) ...@@ -89,9 +91,11 @@ static int have_reboot_patch(void)
fclose(f); fclose(f);
if (ret != 1) if (ret != 1)
return 0; return 0;
ret = reboot(v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF); ret = reboot(v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF);
if (ret != -1) if (ret != -1)
return 0; return 0;
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment