X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=reboot.c;h=381e4e8955b64934131531d99f8caf4b2e26f72a;hb=215b7bb38dceadca466ea9f7cb53a9d3623668ad;hp=e3fa77a994a1ef73a61b87ff097389ebfc3c779a;hpb=3ed5d021837768405d9f9c9e7d2b05dc6a110d94;p=strace diff --git a/reboot.c b/reboot.c index e3fa77a9..381e4e89 100644 --- a/reboot.c +++ b/reboot.c @@ -1,24 +1,23 @@ #include "defs.h" -#include #include "xlat/bootflags1.h" #include "xlat/bootflags2.h" #include "xlat/bootflags3.h" -int -sys_reboot(struct tcb *tcp) +SYS_FUNC(reboot) { - if (exiting(tcp)) - return 0; + const unsigned int magic1 = tcp->u_arg[0]; + const unsigned int magic2 = tcp->u_arg[1]; + const unsigned int cmd = tcp->u_arg[2]; - printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???"); + printflags(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???"); tprints(", "); - printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???"); + printflags(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???"); tprints(", "); - printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???"); - if (tcp->u_arg[2] == (long) LINUX_REBOOT_CMD_RESTART2) { + printflags(bootflags3, cmd, "LINUX_REBOOT_CMD_???"); + if (cmd == LINUX_REBOOT_CMD_RESTART2) { tprints(", "); - printstr(tcp, tcp->u_arg[3], -1); + printstr(tcp, tcp->u_arg[3]); } - return 0; + return RVAL_DECODED; }