diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-07 12:55:44 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-07 12:56:48 +0000 |
commit | 75e032e18a70dd99fa5787a938ef2f51f515595d (patch) | |
tree | 4bf9397deb5ff4a5765486fd1fcca5ee26a97dfd /lib/igt_aux.c | |
parent | 4b4a6d98f7fedff05e3fec947b29bf90ab151a1f (diff) |
lib: Check for dead parent first in hang detector
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r-- | lib/igt_aux.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); |