diff options
author | June McEnroe <june@causal.agency> | 2021-09-25 18:30:57 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-09-25 18:30:57 -0400 |
commit | 47864388853c1e26d9375902ae43d5b5faaf8a3e (patch) | |
tree | 066ce7071b51fc96bb710a8cfbb393c9aea6080b /bin | |
parent | Revert "Add cat alias using less" (diff) | |
download | src-47864388853c1e26d9375902ae43d5b5faaf8a3e.tar.gz src-47864388853c1e26d9375902ae43d5b5faaf8a3e.zip |
Set SO_REUSEADDR in quick
Diffstat (limited to '')
-rw-r--r-- | bin/quick.c | 3 |
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), |