From: Mikhail Gusarov Date: Fri, 28 Mar 2014 16:36:23 +0000 (+0100) Subject: Don't call listen(3) on systemd sockets, already done X-Git-Tag: 0.7.0~346^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=16372c22a3c79e851e64be14f792d6867f2e2054;p=rspamd.git Don't call listen(3) on systemd sockets, already done --- 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));