From 9a8579d95659c65cca7a0d5030597e865e574125 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Dec 2024 14:21:42 +0100 Subject: [PATCH] event/ServerSocket: do not close all listeners before rethrowing If binding one address fails, we don't need to close all listeners. For fatal errors, this will be done automatically and implicitly; and for non-fatal errors (e.g. binding to the default port failed, but there is an XDG listener), this closes the good listeners which are supposed to be used. Closes https://github.com/MusicPlayerDaemon/MPD/pull/2157 --- src/event/ServerSocket.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index 2fcca8a7c8..274d1f3c06 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -216,7 +216,6 @@ ServerSocket::Open() continue; if (bad != nullptr && i.GetSerial() != bad->GetSerial()) { - Close(); std::rethrow_exception(last_error); } @@ -257,7 +256,6 @@ ServerSocket::Open() } if (bad != nullptr) { - Close(); std::rethrow_exception(last_error); } }