From 75e032e18a70dd99fa5787a938ef2f51f515595d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 7 Mar 2017 12:55:44 +0000 Subject: lib: Check for dead parent first in hang detector Signed-off-by: Chris Wilson --- lib/igt_aux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/igt_aux.c') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index eb4ca640..447e4f08 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -367,9 +367,13 @@ hang_detector_process(pid_t pid, dev_t rdev) pfd.events = POLLIN; while (poll(&pfd, 1, -1) > 0) { - struct udev_device *dev = udev_monitor_receive_device(mon); + struct udev_device *dev; dev_t devnum; + if (kill(pid, 0)) /* Parent has died, so must we. */ + break; + + dev = udev_monitor_receive_device(mon); if (dev == NULL) continue; @@ -383,8 +387,6 @@ hang_detector_process(pid_t pid, dev_t rdev) } udev_device_unref(dev); - if (kill(pid, 0)) /* Parent has died, so must we. */ - break; } exit(0); -- cgit v1.2.3