Do not use hard-coded values in halt.c and reboot.c
This commit is contained in:
parent
1a090bf1eb
commit
a0858fa9e8
4
halt.c
4
halt.c
@ -33,8 +33,8 @@ main(int argc, char *argv[])
|
|||||||
if (pflag)
|
if (pflag)
|
||||||
cmd = LINUX_REBOOT_CMD_POWER_OFF;
|
cmd = LINUX_REBOOT_CMD_POWER_OFF;
|
||||||
|
|
||||||
if (syscall(__NR_reboot, 0xfee1dead, 672274793,
|
if (syscall(__NR_reboot, LINUX_REBOOT_MAGIC1,
|
||||||
cmd, NULL) < 0)
|
LINUX_REBOOT_MAGIC2, cmd, NULL) < 0)
|
||||||
eprintf("reboot:");
|
eprintf("reboot:");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
3
reboot.c
3
reboot.c
@ -24,7 +24,8 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
if (syscall(__NR_reboot, 0xfee1dead, 672274793,
|
if (syscall(__NR_reboot, LINUX_REBOOT_MAGIC1,
|
||||||
|
LINUX_REBOOT_MAGIC2,
|
||||||
LINUX_REBOOT_CMD_RESTART, NULL) < 0)
|
LINUX_REBOOT_CMD_RESTART, NULL) < 0)
|
||||||
eprintf("reboot:");
|
eprintf("reboot:");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user