]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Set listener fd to -1 after closing it
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 18 Jun 2018 19:53:38 +0000 (22:53 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 18 Jun 2018 20:02:03 +0000 (20:02 +0000)
The listener fds weren't used for anything afterwards, so it wasn't a
problem so far. The next commit requires it though.

src/master/service-listen.c

index 4f5c51465b030dc38f6b3dcd3ecabaea59a3b1f8..b96c5dc681ca181df2f9f3d521b323b03a1293c3 100644 (file)
@@ -464,8 +464,7 @@ int services_listen_using(struct service_list *new_service_list,
                if (old_listeners[j]->fd == -1)
                        continue;
 
-               if (close(old_listeners[j]->fd) < 0)
-                       i_error("close(listener) failed: %m");
+               i_close_fd(&old_listeners[j]->fd);
                switch (old_listeners[j]->type) {
                case SERVICE_LISTENER_UNIX:
                case SERVICE_LISTENER_FIFO: {