X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=input.cpp;fp=input.cpp;h=ccc4bc0134e47870ae5e44f7f5c9210d897260bd;hp=47c3c0193472d8cfa56747fd2461cdf5595632cd;hb=5ab36b04b0c12058394335e891398c494df513d2;hpb=656d6863b47e1791a310397d88e25fa897e05012 diff --git a/input.cpp b/input.cpp index 47c3c01..ccc4bc0 100644 --- a/input.cpp +++ b/input.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -128,6 +129,7 @@ void Input::stop() { should_stop = true; + pthread_kill(worker_thread, SIGHUP); if (pthread_join(worker_thread, NULL) == -1) { perror("pthread_join"); exit(1); @@ -269,7 +271,7 @@ void Input::do_work() pfd.events |= POLLRDHUP; int nfds = poll(&pfd, 1, 50); - if (nfds == 0 || (nfds == -1 && errno == EAGAIN)) { + if (nfds == 0 || (nfds == -1 && errno == EINTR)) { continue; } if (nfds == -1) {