about summary refs log tree commit diff stats
path: root/src/ips
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-11 21:24:01 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-11 21:47:20 +0100
commit339a167f6bf8f4bd8c22c1bdfad645aad0732371 (patch)
tree014e7a5ff87ef34fd9869fdbd579d1edb91a0367 /src/ips
parentfca4ef9b8fabebb3a9173293908ee9b56acc9cc5 (diff)
downloadchawan-339a167f6bf8f4bd8c22c1bdfad645aad0732371.tar.gz
Add border-collapse, border-spacing; fix fd sending hack
Note that they don't actually work correctly because of rounding errors.
The fd sending hack now emits C directly. Let's hope this actually
works.
Diffstat (limited to 'src/ips')
-rw-r--r--src/ips/socketstream.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ips/socketstream.nim b/src/ips/socketstream.nim
index e411956c..4f98517c 100644
--- a/src/ips/socketstream.nim
+++ b/src/ips/socketstream.nim
@@ -69,9 +69,10 @@ proc sendFileHandle*(s: SocketStream, fd: FileHandle) =
   hdr.msg_control = cmsgbuf
   hdr.msg_controllen = CMSG_LEN(csize_t(sizeof(FileHandle)))
   let cmsg = CMSG_FIRSTHDR(addr hdr)
-  # ...this is stupid.
-  var xl = CMSG_LEN(csize_t(sizeof(FileHandle)))
-  cast[ptr uint16](addr cmsg.cmsg_len)[] = cast[ptr uint16](addr xl)[]
+  # ...sigh
+  {.emit: [
+  cmsg.cmsg_len, """ = CMSG_LEN(sizeof(int));"""
+  ].}
   cmsg.cmsg_level = SOL_SOCKET
   cmsg.cmsg_type = SCM_RIGHTS
   cast[ptr FileHandle](CMSG_DATA(cmsg))[] = fd