Commit 0dc316de authored by David S. Miller's avatar David S. Miller

[SPARC64]: Remove interruptible_sleep_on() usage, with help from Tom Callaway.

parent ad3258ed
......@@ -69,18 +69,26 @@ static int powerd(void *__unused)
{
static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
char *argv[] = { "/sbin/shutdown", "-h", "now", NULL };
DECLARE_WAITQUEUE(wait, current);
daemonize("powerd");
add_wait_queue(&powerd_wait, &wait);
again:
while (button_pressed == 0) {
for (;;) {
set_task_state(current, TASK_INTERRUPTIBLE);
if (button_pressed)
break;
flush_signals(current);
interruptible_sleep_on(&powerd_wait);
schedule();
}
__set_current_state(TASK_RUNNING);
remove_wait_queue(&powerd_wait, &wait);
/* Ok, down we go... */
if (execve("/sbin/shutdown", argv, envp) < 0) {
printk("powerd: shutdown execution failed\n");
add_wait_queue(&powerd_wait, &wait);
button_pressed = 0;
goto again;
}
......
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