about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/io/poll.nim6
-rw-r--r--src/loader/loaderiface.nim2
-rw-r--r--src/server/buffer.nim4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/io/poll.nim b/src/io/poll.nim
index 3c2c29a8..f394233e 100644
--- a/src/io/poll.nim
+++ b/src/io/poll.nim
@@ -37,4 +37,8 @@ proc clear*(ctx: var PollData) =
 
 proc poll*(ctx: var PollData; timeout: cint) =
   ctx.trim()
-  discard poll(addr ctx.fds[0], Tnfds(ctx.fds.len), cint(timeout))
+  let fds = addr ctx.fds[0]
+  let nfds = cint(ctx.fds.len)
+  {.emit: """
+  poll(`fds`, `nfds`, `timeout`);
+  """.}
diff --git a/src/loader/loaderiface.nim b/src/loader/loaderiface.nim
index 51f02480..772d9b32 100644
--- a/src/loader/loaderiface.nim
+++ b/src/loader/loaderiface.nim
@@ -447,6 +447,6 @@ when defined(freebsd):
 proc setSocketDir*(loader: FileLoader; path: string) =
   loader.sockDir = path
   when defined(freebsd):
-    loader.sockDirFd = open(cstring(path), O_DIRECTORY)
+    loader.sockDirFd = int(newPosixStream(path, O_DIRECTORY, 0).fd)
   else:
     loader.sockDirFd = -1
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index c22b02db..8a124b2f 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -912,10 +912,6 @@ proc rewind(buffer: Buffer; offset: int; unregister = true): bool =
   buffer.bytesRead = offset
   return true
 
-when defined(freebsd) or defined(openbsd):
-  # necessary for an ugly hack we will do later
-  import std/kqueue
-
 var gssock* {.global.}: ServerSocket
 var gpstream* {.global.}: SocketStream