From c767e07df39e05c1a2e39d30547cef16ca40aedd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 2 Oct 2009 09:35:23 +0200 Subject: [PATCH] screen_client: recover from UPDATE_ALREADY error If mpd_connection_clear_error() fails, revert to mpdclient_handle_error(). --- src/screen_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.30.2