]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lua event.socket(): disable a hacky workaround
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 28 Feb 2019 06:39:47 +0000 (07:39 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 28 Feb 2019 09:59:50 +0000 (10:59 +0100)
It should be fixed in quite old libuv versions already:
https://github.com/libuv/libuv/issues/883

NEWS
daemon/bindings/event.c

diff --git a/NEWS b/NEWS
index 1fa781ea9982d6a9088d0460b23ea853a5dcde2d..ebeef87b2330483aba550e9dbf578fab83a4f58c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Bugfixes
   that were loaded as unmanaged trust anchors (!753)
 - trust_anchors.add(): include these TAs in .summary() (!753)
 - policy module: support '#' for separating port numbers, for consistency
+- fix startup on macOS+BSD when </dev/null and cqueues installed
 
 Improvements
 ------------
index c665dac64a22b439d2923c2f509498d182ea079c..98180f758bc65c13cf80d9bf4378f75c82710be8 100644 (file)
@@ -185,24 +185,9 @@ static int event_fdwatch(lua_State *L)
        /* Start timer with the reference */
        int sock = lua_tointeger(L, 1);
        uv_loop_t *loop = uv_default_loop();
-#if defined(__APPLE__) || defined(__FreeBSD__)
-       /* libuv is buggy and fails to create poller for
-        * kqueue sockets as it can't be fcntl'd to non-blocking mode,
-        * so we pass it a copy of standard input and then
-        * switch it with real socket before starting the poller
-        */
-       int decoy_fd = dup(STDIN_FILENO);
-       int ret = uv_poll_init(loop, handle, decoy_fd);
-       if (ret == 0) {
-               handle->io_watcher.fd = sock;
-       }
-       close(decoy_fd);
-#else
        int ret = uv_poll_init(loop, handle, sock);
-#endif
-       if (ret == 0) {
+       if (ret == 0)
                ret = uv_poll_start(handle, UV_READABLE, event_fdcallback);
-       }
        if (ret != 0) {
                free(handle);
                lua_error_p(L, "couldn't start event poller");