commit | 48237b0c88343154d58854020c3a9c8b07c61b10 | [log] [tgz] |
---|---|---|
author | Denis Vlasenko <vda.linux@googlemail.com> | Wed Nov 22 23:22:06 2006 +0000 |
committer | Denis Vlasenko <vda.linux@googlemail.com> | Wed Nov 22 23:22:06 2006 +0000 |
tree | b36bc84f22dd797b45c8d665e50e2f6c690e1370 | |
parent | b40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d [diff] [blame] |
introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd), use them where appropriate. 200 bytes saved
diff --git a/networking/nc.c b/networking/nc.c index 2f8a36b..5fd9242 100644 --- a/networking/nc.c +++ b/networking/nc.c
@@ -85,8 +85,7 @@ if (!cfd) { sfd = xsocket(AF_INET, SOCK_STREAM, 0); fcntl(sfd, F_SETFD, FD_CLOEXEC); - opt = 1; - setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); + setsockopt_reuseaddr(sfd); address.sin_family = AF_INET; // Set local port.