]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
log: Use the new listener type field to distinguish the various listener types.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 22 Nov 2022 20:50:52 +0000 (21:50 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Sun, 11 Dec 2022 21:58:50 +0000 (21:58 +0000)
src/log/log-settings.c
src/log/main.c

index f2cc1a2d72444a277ba98d95c3562948f067bf9c..f68e1c2508fefad8a4d55aaad2b85129bc8c1467 100644 (file)
@@ -11,6 +11,7 @@
 static struct file_listener_settings log_unix_listeners_array[] = {
        {
                .path = "log-errors",
+               .type = "errors",
                .mode = 0600,
                .user = "",
                .group = "",
index a6ac950a67940d2be3afe2d2f7249216b875c308..7988083cae55659330c3b03b9a812ae165296550 100644 (file)
@@ -48,11 +48,15 @@ static void client_connected(struct master_service_connection *conn)
                   but here we want log process to stay open until all writers
                   have closed */
                conn->fifo = FALSE;
-       } else if (strcmp(conn->name, "log-errors") == 0)
-               doveadm_connection_create(errorbuf, conn->fd);
-       else {
-               i_error("Unknown listener name: %s", conn->name);
-               return;
+       } else {
+               const char *type = master_service_connection_get_type(conn);
+
+               if (strcmp(type, "errors") == 0)
+                       doveadm_connection_create(errorbuf, conn->fd);
+               else {
+                       i_error("Unknown listener type/name: %s", type);
+                       return;
+               }
        }
 
        master_service_client_connection_accept(conn);