about summary refs log tree commit diff stats
path: root/src/ips
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-05 00:17:18 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-05 00:17:18 +0100
commitd42cec62dbfdcd4058ba878e5a43d9bb4205070f (patch)
treef9a13949a2a7d3086e25c3bf926654b1631aeb2b /src/ips
parentae3bbcae299983eac514fa803d46e65058cbee39 (diff)
downloadchawan-d42cec62dbfdcd4058ba878e5a43d9bb4205070f.tar.gz
sigh
Diffstat (limited to 'src/ips')
-rw-r--r--src/ips/socketstream.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ips/socketstream.nim b/src/ips/socketstream.nim
index ff2d189e..5c3ad622 100644
--- a/src/ips/socketstream.nim
+++ b/src/ips/socketstream.nim
@@ -43,7 +43,8 @@ proc sendFileHandle*(s: SocketStream, fd: FileHandle) =
   hdr.msg_iov = addr iov
   hdr.msg_iovlen = 1
   hdr.msg_control = cmsgbuf
-  hdr.msg_controllen = CMSG_LEN(csize_t(sizeof(FileHandle)))
+  # ...this is stupid.
+  cast[ptr uint16](hdr.msg_controllen)[] = cast[ptr uint16](CMSG_LEN(csize_t(sizeof(FileHandle))))[]
   let cmsg = CMSG_FIRSTHDR(addr hdr)
   cmsg.cmsg_len = CMSG_LEN(csize_t(sizeof(FileHandle)))
   cmsg.cmsg_level = SOL_SOCKET