From 5fe8a76ab35012a0a5e1bd8cc5ff4a6f059f37f5 Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 25 Sep 2008 20:11:43 +0000 Subject: [PATCH] set SO_REUSEADDR on the listen socket -- kevin brintnall git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1524 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_daemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index a94e079..f1221e3 100644 --- a/src/rrd_daemon.c +++ b/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) { -- 2.30.2