From: oetiker Date: Thu, 25 Sep 2008 20:11:43 +0000 (+0000) Subject: set SO_REUSEADDR on the listen socket -- kevin brintnall X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fc55d35dcaeb3b8a2a308c1ad8ef3c399c9c6c8e;p=rrdtool-all.git set SO_REUSEADDR on the listen socket -- kevin brintnall git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1524 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c index a94e0794..f1221e3e 100644 --- a/program/src/rrd_daemon.c +++ b/program/src/rrd_daemon.c @@ -1643,6 +1643,7 @@ static int open_listen_socket (const char *addr_orig) /* {{{ */ { int fd; listen_socket_t *temp; + int one = 1; temp = (listen_socket_t *) realloc (listen_fds, sizeof (listen_fds[0]) * (listen_fds_num + 1)); @@ -1661,6 +1662,8 @@ static int open_listen_socket (const char *addr_orig) /* {{{ */ continue; } + setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); + status = bind (fd, ai_ptr->ai_addr, ai_ptr->ai_addrlen); if (status != 0) {