From: Max Kellermann Date: Fri, 2 Oct 2009 07:35:23 +0000 (+0200) Subject: screen_client: recover from UPDATE_ALREADY error X-Git-Tag: release-0.16~217 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c767e07df39e05c1a2e39d30547cef16ca40aedd;p=ncmpc.git screen_client: recover from UPDATE_ALREADY error If mpd_connection_clear_error() fails, revert to mpdclient_handle_error(). --- diff --git a/src/screen_client.c b/src/screen_client.c index 9d60ed2..9e13ba0 100644 --- a/src/screen_client.c +++ b/src/screen_client.c @@ -78,10 +78,10 @@ screen_database_update(struct mpdclient *c, const char *path) id = mpd_run_update(c->connection, path); if (id == 0) { if (mpd_connection_get_error(c->connection) == MPD_ERROR_SERVER && - mpd_connection_get_server_error(c->connection) == MPD_SERVER_ERROR_UPDATE_ALREADY) { + mpd_connection_get_server_error(c->connection) == MPD_SERVER_ERROR_UPDATE_ALREADY && + mpd_connection_clear_error(c->connection)) screen_status_printf(_("Database update running...")); - mpd_connection_clear_error(c->connection); - } else + else mpdclient_handle_error(c); return; }