summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2015-04-29 10:33:19 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-04-29 10:33:19 +0100
commite7016d30f3a0ae817c77ccbd962f776ac3e7e100 (patch)
tree88d4dd8e56276d35f57aff0db24868ecc5b382fd /src
parent1a67dacd7514c3327ca0fd27e617309fd437e44f (diff)
backlight: Do not hang forever if helper pid is -1
Backlight helper PID is set to -1 by default, if for some reason it's not set, we may end up with waitpid(-1, ...) which will hang forever. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90230 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/backlight.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backlight.c b/src/backlight.c
index 84d8f761..c65e466b 100644
--- a/src/backlight.c
+++ b/src/backlight.c
@@ -523,7 +523,7 @@ void backlight_disable(struct backlight *b)
void backlight_close(struct backlight *b)
{
backlight_disable(b);
- if (b->pid)
+ if (b->pid > 0)
waitpid(b->pid, NULL, 0);
}