From: Max Kellermann Date: Sat, 25 Mar 2017 19:53:35 +0000 (+0100) Subject: mpdclient: move aconnect_start() call to a separate function X-Git-Tag: v0.27~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0236c335857851885f0c18c40bb66104635da963;p=ncmpc.git mpdclient: move aconnect_start() call to a separate function --- diff --git a/src/mpdclient.c b/src/mpdclient.c index 8c18a0c..870839f 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -345,6 +345,16 @@ static const struct aconnect_handler mpdclient_connect_handler = { .error = mpdclient_connect_error, }; +static void +mpdclient_aconnect_start(struct mpdclient *c, + const struct mpd_settings *settings) +{ + aconnect_start(&c->async_connect, + mpd_settings_get_host(settings), + mpd_settings_get_port(settings), + &mpdclient_connect_handler, c); +} + #endif void @@ -354,10 +364,7 @@ mpdclient_connect(struct mpdclient *c) mpdclient_disconnect(c); #ifdef ENABLE_ASYNC_CONNECT - aconnect_start(&c->async_connect, - mpd_settings_get_host(c->settings), - mpd_settings_get_port(c->settings), - &mpdclient_connect_handler, c); + mpdclient_aconnect_start(c, c->settings); #else /* connect to MPD */ struct mpd_connection *connection =