]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Don't try to close(-1)
authorTimo Sirainen <tss@iki.fi>
Tue, 23 Jun 2009 21:31:29 +0000 (17:31 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 23 Jun 2009 21:31:29 +0000 (17:31 -0400)
--HG--
branch : HEAD

src/lib-master/master-service-settings.c

index 884e147b932041c12c190aed618d1b14ab9ace04..d65817b0670efb9d9fc0bf402129cf28e5be2524 100644 (file)
@@ -232,10 +232,10 @@ int master_service_settings_read(struct master_service *service,
                }
        }
 
-       if ((service->flags & MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN) == 0)
-               (void)close(fd);
-       else
+       if ((service->flags & MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN) != 0)
                service->config_fd = fd;
+       else if (fd != -1)
+               (void)close(fd);
 
        /* let environment override settings. especially useful for the
           settings from userdb. */