From 0049ea38be72884fabeee3ce52e2d6796c3abd53 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 14 May 2020 21:42:46 +0200 Subject: ipc: exit client if the FD is invalid This does not normally happen. But since the --input-ipc-client option can pass in raw FDs, it's probably a good thing in the interest of making mistakes obvious. Without this, it just burned a core on invalid FDs (poll() always returned immediately). --- input/ipc-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'input/ipc-unix.c') diff --git a/input/ipc-unix.c b/input/ipc-unix.c index b237efa1a0..abef0972d9 100644 --- a/input/ipc-unix.c +++ b/input/ipc-unix.c @@ -163,7 +163,7 @@ static void *client_thread(void *p) } } - if (fds[1].revents & (POLLIN | POLLHUP)) { + if (fds[1].revents & (POLLIN | POLLHUP | POLLNVAL)) { while (1) { char buf[128]; bstr append = { buf, 0 }; -- cgit v1.2.3