sched: fix return value of wait_for_completion_interruptible()
The recent wait_for_completion() cleanups:
commit 8cbbe86dfc
Author: Andi Kleen <ak@suse.de>
Date: Mon Oct 15 17:00:14 2007 +0200
sched: cleanup: refactor common code of sleep_on / wait_for_completion
Refactor common code of sleep_on / wait_for_completion
broke the return value of wait_for_completion_interruptible().
Previously it returned 0 on success, now -1. Fix that.
Problem found by Geert Uytterhoeven.
[ mingo: fixed whitespace damage ]
Reported-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d85714d81c
commit
51e9799023
1 changed files with 4 additions and 1 deletions
|
@ -3859,7 +3859,10 @@ EXPORT_SYMBOL(wait_for_completion_timeout);
|
||||||
|
|
||||||
int __sched wait_for_completion_interruptible(struct completion *x)
|
int __sched wait_for_completion_interruptible(struct completion *x)
|
||||||
{
|
{
|
||||||
return wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
|
long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
|
||||||
|
if (t == -ERESTARTSYS)
|
||||||
|
return t;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(wait_for_completion_interruptible);
|
EXPORT_SYMBOL(wait_for_completion_interruptible);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue