]> source.dussan.org Git - rspamd.git/commitdiff
Don't call listen(3) on systemd sockets, already done
authorMikhail Gusarov <dottedmag@dottedmag.net>
Fri, 28 Mar 2014 16:36:23 +0000 (17:36 +0100)
committerMikhail Gusarov <dottedmag@dottedmag.net>
Fri, 28 Mar 2014 17:02:44 +0000 (18:02 +0100)
src/main.c

index 364e2095026a1283ec85ee424ce24567adc9df17..6b71b0f53c045650e4ce8170876de1881612e6d1 100644 (file)
@@ -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));