diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-25 12:23:59 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-25 12:23:59 +0200 |
commit | ace7f1b79670aa0c1d9f4b0442be82e565827333 (patch) | |
tree | ed4625a9cbc8e28db2b1ff9fad111c4c012508a3 /kernel/sched.c | |
parent | a60b33cf59d1c9e0e363287fce799cb23d45660c (diff) | |
parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) | |
download | op-kernel-dev-ace7f1b79670aa0c1d9f4b0442be82e565827333.zip op-kernel-dev-ace7f1b79670aa0c1d9f4b0442be82e565827333.tar.gz |
Merge branch 'linus' into core/softirq
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 33680bc..5695835 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -4398,22 +4398,20 @@ do_wait_for_common(struct completion *x, long timeout, int state) signal_pending(current)) || (state == TASK_KILLABLE && fatal_signal_pending(current))) { - __remove_wait_queue(&x->wait, &wait); - return -ERESTARTSYS; + timeout = -ERESTARTSYS; + break; } __set_current_state(state); spin_unlock_irq(&x->wait.lock); timeout = schedule_timeout(timeout); spin_lock_irq(&x->wait.lock); - if (!timeout) { - __remove_wait_queue(&x->wait, &wait); - return timeout; - } - } while (!x->done); + } while (!x->done && timeout); __remove_wait_queue(&x->wait, &wait); + if (!x->done) + return timeout; } x->done--; - return timeout; + return timeout ?: 1; } static long __sched |