Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143217
b: refs/heads/master
c: 3d26dcf
h: refs/heads/master
i:
  143215: 25ca25f
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Apr 13, 2009
1 parent 65c1599 commit 5e4c2df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cafbd0b94d2c8cae6ede6d1c3ab90547547a3d2
refs/heads/master: 3d26dcf7679c5cc6c9f3b95ffdb2152fba2b7fae
24 changes: 9 additions & 15 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
void __user *, arg)
{
char buffer[256];
int ret = 0;

/* We only trust the superuser with rebooting the system. */
if (!capable(CAP_SYS_BOOT))
Expand Down Expand Up @@ -397,7 +398,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
kernel_halt();
unlock_kernel();
do_exit(0);
break;
panic("cannot halt");

case LINUX_REBOOT_CMD_POWER_OFF:
kernel_power_off();
Expand All @@ -417,29 +418,22 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,

#ifdef CONFIG_KEXEC
case LINUX_REBOOT_CMD_KEXEC:
{
int ret;
ret = kernel_kexec();
unlock_kernel();
return ret;
}
ret = kernel_kexec();
break;
#endif

#ifdef CONFIG_HIBERNATION
case LINUX_REBOOT_CMD_SW_SUSPEND:
{
int ret = hibernate();
unlock_kernel();
return ret;
}
ret = hibernate();
break;
#endif

default:
unlock_kernel();
return -EINVAL;
ret = -EINVAL;
break;
}
unlock_kernel();
return 0;
return ret;
}

static void deferred_cad(struct work_struct *dummy)
Expand Down

0 comments on commit 5e4c2df

Please sign in to comment.