77fbe6944f
When using poll, kevent, or select there was a race window during which it would be impossible to shut down the daemon. The problem was that poll, kevent, and select don't return when the file descriptor gets closed (or maybe it was that the file descriptor got closed before those syscalls were entered?). The solution is to impose a timeout on those syscalls, and check m_quit after they time out. Sponsored by: The FreeBSD Foundation