All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backlight: Do not hang forever if helper pid is -1
@ 2015-04-29  9:19 Olivier Fourdan
  2015-04-29  9:35 ` Chris Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Fourdan @ 2015-04-29  9:19 UTC (permalink / raw)
  To: intel-gfx

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>
---
 src/backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backlight.c b/src/backlight.c
index 84d8f76..c65e466 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);
 }
 
-- 
2.3.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] backlight: Do not hang forever if helper pid is -1
  2015-04-29  9:19 [PATCH] backlight: Do not hang forever if helper pid is -1 Olivier Fourdan
@ 2015-04-29  9:35 ` Chris Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2015-04-29  9:35 UTC (permalink / raw)
  To: Olivier Fourdan; +Cc: intel-gfx

On Wed, Apr 29, 2015 at 11:19:47AM +0200, Olivier Fourdan wrote:
> 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>

Nice catch. Pushed with thanks,
   1a67dac..e7016d3  master -> master
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-29  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29  9:19 [PATCH] backlight: Do not hang forever if helper pid is -1 Olivier Fourdan
2015-04-29  9:35 ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.