Commit 497bd073 authored by Jérôme Poulin's avatar Jérôme Poulin

Fix SO_REUSEADDR which was not initialized.

- SO_REUSEADDR wasn't set most of the time since it was depending
  on uninitialized optval.
parent c6238d6f
...@@ -145,7 +145,7 @@ int parse_options(int argc, char *argv[]) { ...@@ -145,7 +145,7 @@ int parse_options(int argc, char *argv[]) {
/* Create server socket */ /* Create server socket */
int create_socket(int port) { int create_socket(int port) {
int server_sock, optval; int server_sock, optval = 1;
struct sockaddr_in server_addr; struct sockaddr_in server_addr;
if ((server_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { if ((server_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment