Listen: eliminate local variable

This commit is contained in:
Max Kellermann 2014-02-19 23:50:47 +01:00
parent e609c88334
commit d884272ba8

View File

@ -106,7 +106,6 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error)
int port = config_get_positive(CONF_PORT, DEFAULT_PORT);
const struct config_param *param =
config_get_next_param(CONF_BIND_TO_ADDRESS, nullptr);
bool success;
listen_socket = new ClientListener(loop, partition);
@ -138,8 +137,7 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error)
/* no "bind_to_address" configured, bind the
configured port on all interfaces */
success = listen_socket->AddPort(port, error);
if (!success) {
if (!listen_socket->AddPort(port, error)) {
delete listen_socket;
error.FormatPrefix("Failed to listen on *:%d: ", port);
return false;