aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2014-03-28 17:36:23 +0100
committerMikhail Gusarov <dottedmag@dottedmag.net>2014-03-28 18:02:44 +0100
commit16372c22a3c79e851e64be14f792d6867f2e2054 (patch)
tree482f1d1f4f4951c1fe4a10a01f402e4f8cee5450 /src/main.c
parent1e1a8b00975dcf278c7987e3905c9147e23a1d02 (diff)
downloadrspamd-16372c22a3c79e851e64be14f792d6867f2e2054.tar.gz
rspamd-16372c22a3c79e851e64be14f792d6867f2e2054.zip
Don't call listen(3) on systemd sockets, already done
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 364e20950..6b71b0f53 100644
--- a/src/main.c
+++ b/src/main.c
@@ -550,7 +550,7 @@ create_listen_socket (const gchar *addr, gint port, gint listen_type)
}
static GList *
-systemd_get_socket (gint number, gint listen_type)
+systemd_get_socket (gint number)
{
int sock, max, flags;
GList *result = NULL;
@@ -573,11 +573,6 @@ systemd_get_socket (gint number, gint listen_type)
errno = EINVAL;
return NULL;
}
- if (listen_type != SOCK_DGRAM) {
- if (listen (sock, -1) == -1) {
- return NULL;
- }
- }
flags = fcntl (sock, F_GETFD);
if (flags != -1) {
(void)fcntl (sock, F_SETFD, flags | FD_CLOEXEC);
@@ -651,7 +646,7 @@ spawn_workers (struct rspamd_main *rspamd)
cf->worker->listen_type);
}
else {
- ls = systemd_get_socket (bcf->ai, cf->worker->listen_type);
+ ls = systemd_get_socket (bcf->ai);
}
if (ls == NULL) {
msg_err ("cannot listen on socket %s: %s", bcf->bind_host, strerror (errno));