From e7cfad933c05102184d3ce63939dff11742dd46e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Dec 2015 12:02:41 +0100 Subject: listen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/satd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/satd.c b/src/satd.c index 0f7e200..490f1e9 100644 --- a/src/satd.c +++ b/src/satd.c @@ -30,6 +30,15 @@ +/** + * The size of the backlog on the socket. + */ +#ifndef SATD_BACKLOG +# define SATD_BACKLOG 5 +#endif + + + COMMAND("satd") USAGE("[-f]") @@ -103,6 +112,12 @@ main(int argc, char *argv[]) close(sock), sock = 3; } +#ifdef SOMAXCONN < SATD_BACKLOG + t (listen(sock, SOMAXCONN)); +#else + t (listen(sock, SATD_BACKLOG)); +#endif + close(sock); unlink(address.sun_path); undaemonise(); -- cgit v1.2.3-70-g09d2