acpid will hang in an endless loop if we unplug an input device, for example USB mouse or keyboard after acpid has started.
To work around this we simply close the handle. Signed-off-by: Natanael Copa <[email protected]> --- util-linux/acpid.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 6e7321b..39c58f2 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c @@ -294,6 +294,11 @@ int acpid_main(int argc UNUSED_PARAM, char **argv) memset(&ev, 0, sizeof(ev)); + if (pfd[i].revents & (POLLERR | POLLHUP)) { + close(pfd[i].fd); + pfd[i].fd = -1; + } + if (!(pfd[i].revents & POLLIN)) continue; -- 1.7.8.2 _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
