Skip to content
Snippets Groups Projects
Commit 5aca5ced authored by Petr Špaček's avatar Petr Špaček
Browse files

Merge branch 'stdin-null' into 'master'

lua event.socket(): remove a hacky workaround

See merge request !778
parents cd9d84d4 95a326fc
Branches
Tags
1 merge request!778lua event.socket(): remove a hacky workaround
Pipeline #46033 failed with stages
in 6 minutes and 36 seconds
......@@ -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
------------
......
......@@ -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");
......
File moved
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment