summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-25 18:30:57 -0400
committerJune McEnroe <june@causal.agency>2021-09-25 18:30:57 -0400
commit47864388853c1e26d9375902ae43d5b5faaf8a3e (patch)
tree066ce7071b51fc96bb710a8cfbb393c9aea6080b
parentRevert "Add cat alias using less" (diff)
downloadsrc-47864388853c1e26d9375902ae43d5b5faaf8a3e.tar.gz
src-47864388853c1e26d9375902ae43d5b5faaf8a3e.zip
Set SO_REUSEADDR in quick
-rw-r--r--bin/quick.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/quick.c b/bin/quick.c
index d6361aad..edf35a3b 100644
--- a/bin/quick.c
+++ b/bin/quick.c
@@ -122,6 +122,9 @@ int main(int argc, char *argv[]) {
 	if (server < 0) err(EX_OSERR, "socket");
 	fcntl(server, F_SETFD, FD_CLOEXEC);
 
+	int on = 1;
+	setsockopt(server, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+
 	struct sockaddr_in addr = {
 		.sin_family = AF_INET,
 		.sin_port = htons(port),