aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 12:02:41 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 12:02:41 +0100
commite7cfad933c05102184d3ce63939dff11742dd46e (patch)
tree7c605eb9197f823bf46038e0b5adc795c665e00a /src
parentm (diff)
downloadsat-e7cfad933c05102184d3ce63939dff11742dd46e.tar.gz
sat-e7cfad933c05102184d3ce63939dff11742dd46e.tar.bz2
sat-e7cfad933c05102184d3ce63939dff11742dd46e.tar.xz
listen
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/satd.c15
1 files changed, 15 insertions, 0 deletions
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();