hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 304e286d076e9940409ce1f35cf287b59eac38bd
parent cef7148ae6f7ed7a51a18da46e0cbdf71a60560e
Author: Ember Sawady <ecs@d2evs.net>
Date:   Sun, 27 Aug 2023 21:34:52 +0000

net: fix cmsg_len

cmsg_space aligns the data to size(rt::cmsghdr), cmsg_len doesn't. also
adjusted cmsg_space's formatting a bit in order to make the parallel
with cmsg_len clearer

Signed-off-by: Ember Sawady <ecs@d2evs.net>

Diffstat:
Mnet/msg.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/msg.ha b/net/msg.ha @@ -116,5 +116,5 @@ export fn getcontrol( }; fn cmsg_align(z: size) size = (z + size(size) - 1) & ~(size(size) - 1); -fn cmsg_len(z: size) size = cmsg_align(size(rt::cmsghdr) + z); -fn cmsg_space(z: size) size = cmsg_align(z) + cmsg_align(size(rt::cmsghdr)); +fn cmsg_len(z: size) size = cmsg_align(size(rt::cmsghdr)) + z; +fn cmsg_space(z: size) size = cmsg_align(size(rt::cmsghdr)) + cmsg_align(z);