summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-07-29 20:56:12 -0400
committerJune McEnroe <june@causal.agency>2018-07-29 20:56:12 -0400
commit9e88922bc090eee0919e5a041d12b5f42aa8b86c (patch)
treea6c5c1c4ad02a46143a30d3ffe7dc1a91de8e13a
parentFix cfmakeraw calls (diff)
downloadsrc-9e88922bc090eee0919e5a041d12b5f42aa8b86c.tar.gz
src-9e88922bc090eee0919e5a041d12b5f42aa8b86c.zip
Fix dtch cmsg size
Apparently you actually need CMSG_SPACE and not just CMSG_LEN... Well
done, everyone.
Diffstat (limited to '')
-rw-r--r--bin/dtch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/dtch.c b/bin/dtch.c
index 94ed88d7..72f88e4d 100644
--- a/bin/dtch.c
+++ b/bin/dtch.c
@@ -56,7 +56,7 @@ static char z;
 static struct iovec iov = { .iov_base = &z, .iov_len = 1 };
 
 static ssize_t sendFd(int sock, int fd) {
-	size_t size = CMSG_LEN(sizeof(int));
+	size_t size = CMSG_SPACE(sizeof(int));
 	char buf[size];
 	struct msghdr msg = {
 		.msg_iov = &iov,
@@ -66,7 +66,7 @@ static ssize_t sendFd(int sock, int fd) {
 	};
 
 	struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg);
-	cmsg->cmsg_len = size;
+	cmsg->cmsg_len = CMSG_LEN(sizeof(int));
 	cmsg->cmsg_level = SOL_SOCKET;
 	cmsg->cmsg_type = SCM_RIGHTS;
 	*(int *)CMSG_DATA(cmsg) = fd;
@@ -75,7 +75,7 @@ static ssize_t sendFd(int sock, int fd) {
 }
 
 static int recvFd(int sock) {
-	size_t size = CMSG_LEN(sizeof(int));
+	size_t size = CMSG_SPACE(sizeof(int));
 	char buf[size];
 	struct msghdr msg = {
 		.msg_iov = &iov,
ct'>Set colours for Xt and cwmJune McEnroe And increase XTerm internalBorder. 2021-02-07Set urgency on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe Weirdly the Fn key doesn't change how the F row registers... I wonder if I can do something about that. 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 11 is what I use on macOS, but I feel like my eyes are working harder here. 2021-02-07Fully configure and rebind cwmJune McEnroe This is sort of a mix of trying to emulate macOS somewhat for my muscle memory and just rebinding some of the cwm defaults to use 4- rather than M-. 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe