summary refs log tree commit diff
path: root/bin
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
commit574b5fd1b58ab993045afd1b80e82f0ad376f150 (patch)
treee3d232faec418f6da1cba6e08f076f742ae2af2b /bin
parentRevert "Add cat alias using less" (diff)
downloadsrc-574b5fd1b58ab993045afd1b80e82f0ad376f150.tar.gz
src-574b5fd1b58ab993045afd1b80e82f0ad376f150.zip
Set SO_REUSEADDR in quick
Diffstat (limited to 'bin')
-rw-r--r--bin/quick.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/quick.c b/bin/quick.c
index cfd871fe..d814873d 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),