about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-05-18 14:44:19 -0400
committerJune McEnroe <june@causal.agency>2020-05-18 14:44:19 -0400
commit4f7066dada94a402d867ceca9a668a6e64d12f3c (patch)
tree9f9aa93653fad589a85d843e656ab428435cc08c
parentEnable TCP keepalive with half-hour idle (diff)
downloadpounce-4f7066dada94a402d867ceca9a668a6e64d12f3c.tar.gz
pounce-4f7066dada94a402d867ceca9a668a6e64d12f3c.zip
Don't bother setting SO_NOSIGPIPE
We need to ignore SIGPIPE anyway for other platforms.
-rw-r--r--compat.h5
-rw-r--r--dispatch.c9
-rw-r--r--local.c7
-rw-r--r--server.c4
4 files changed, 3 insertions, 22 deletions
diff --git a/compat.h b/compat.h
index 01ef10c..f8057c4 100644
--- a/compat.h
+++ b/compat.h
@@ -27,11 +27,6 @@ uint32_t arc4random(void);
 void arc4random_buf(void *buf, size_t nbytes);
 uint32_t arc4random_uniform(uint32_t upper_bound);
 
-// The default value of SO_RCVLOWAT is 1 anyway...
-#ifndef SO_NOSIGPIPE
-#define SO_NOSIGPIPE SO_RCVLOWAT
-#endif
-
 #ifndef SIGINFO
 #define SIGINFO SIGUSR2
 #endif
diff --git a/dispatch.c b/dispatch.c
index 28a4d00..0de7434 100644
--- a/dispatch.c
+++ b/dispatch.c
@@ -214,7 +214,7 @@ int main(int argc, char *argv[]) {
 
 	cap_rights_t dirRights, sockRights, unixRights, bindRights;
 	cap_rights_init(&dirRights, CAP_CONNECTAT);
-	cap_rights_init(&sockRights, CAP_EVENT, CAP_RECV, CAP_SEND, CAP_SETSOCKOPT);
+	cap_rights_init(&sockRights, CAP_EVENT, CAP_RECV, CAP_SEND);
 	cap_rights_init(&unixRights, CAP_CONNECT, CAP_SEND);
 	cap_rights_init(&bindRights, CAP_LISTEN, CAP_ACCEPT);
 	cap_rights_merge(&bindRights, &sockRights);
@@ -255,13 +255,6 @@ int main(int argc, char *argv[]) {
 					warn("accept");
 					continue;
 				}
-
-				int yes = 1;
-				error = setsockopt(
-					sock, SOL_SOCKET, SO_NOSIGPIPE, &yes, sizeof(yes)
-				);
-				if (error) err(EX_OSERR, "setsockopt");
-
 				eventAdd(sock);
 				continue;
 			}
diff --git a/local.c b/local.c
index 50e49d5..c4aea6f 100644
--- a/local.c
+++ b/local.c
@@ -215,11 +215,8 @@ struct tls *localAccept(int *fd, int bind) {
 		*fd = sent;
 	}
 
-	int yes = 1;
-	int error = setsockopt(*fd, SOL_SOCKET, SO_NOSIGPIPE, &yes, sizeof(yes));
-	if (error) err(EX_OSERR, "setsockopt");
-
-	error = setsockopt(*fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
+	int on = 1;
+	int error = setsockopt(*fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
 	if (error) err(EX_OSERR, "setsockopt");
 
 	int idle = 15 * 60;
diff --git a/server.c b/server.c
index 1edeab5..8ea6d19 100644
--- a/server.c
+++ b/server.c
@@ -114,10 +114,6 @@ int serverConnect(const char *bindHost, const char *host, const char *port) {
 	if (sock < 0) err(EX_UNAVAILABLE, "%s:%s", host, port);
 	freeaddrinfo(head);
 
-	int yes = 1;
-	error = setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &yes, sizeof(yes));
-	if (error) err(EX_OSERR, "setsockopt");
-
 	error = tls_connect_socket(client, sock, host);
 	if (error) errx(EX_PROTOCOL, "tls_connect: %s", tls_error(client));
 
> 2021-02-08Use 4M- for window resizing in cwmJune McEnroe 2021-02-08Tweak trackpad scaling, mouse accelerationJune McEnroe This feels more comfortable. 2021-02-08Use xsel in up and add it do install.shJune McEnroe 2021-02-07Swap root window coloursJune McEnroe 2021-02-07Add -X flag to install X stuff on OpenBSDJune McEnroe 2021-02-07Adjust brightness by smaller incrementsJune McEnroe 2021-02-07Fix cwm window cycling, move big by defaultJune McEnroe 2021-02-07Use class names for Foreground, Background, BorderColorJune McEnroe I'm not really sure what difference this makes, but it seems like the right thing to do to be generic? 2021-02-07Add simple battery status and clock to xsessionJune McEnroe I love how simple this is. 2021-02-07Set cursor theme and sizeJune McEnroe 2021-02-07Use scrot for up -s if no screencaptureJune McEnroe Still missing putting the URL in an X selection. 2021-02-07Enable mouse acceleration in XJune McEnroe 2021-02-07Set 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