Commit d884272b authored by Max Kellermann's avatar Max Kellermann

Listen: eliminate local variable

parent e609c883
...@@ -106,7 +106,6 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error) ...@@ -106,7 +106,6 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error)
int port = config_get_positive(CONF_PORT, DEFAULT_PORT); int port = config_get_positive(CONF_PORT, DEFAULT_PORT);
const struct config_param *param = const struct config_param *param =
config_get_next_param(CONF_BIND_TO_ADDRESS, nullptr); config_get_next_param(CONF_BIND_TO_ADDRESS, nullptr);
bool success;
listen_socket = new ClientListener(loop, partition); listen_socket = new ClientListener(loop, partition);
...@@ -138,8 +137,7 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error) ...@@ -138,8 +137,7 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error)
/* no "bind_to_address" configured, bind the /* no "bind_to_address" configured, bind the
configured port on all interfaces */ configured port on all interfaces */
success = listen_socket->AddPort(port, error); if (!listen_socket->AddPort(port, error)) {
if (!success) {
delete listen_socket; delete listen_socket;
error.FormatPrefix("Failed to listen on *:%d: ", port); error.FormatPrefix("Failed to listen on *:%d: ", port);
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment