From 74f9ecca37415f1b1b025fc5b329bcfc7721946b Mon Sep 17 00:00:00 2001 From: Maksym Veremeyenko Date: Mon, 9 Jul 2012 07:59:02 +0300 Subject: [PATCH] fix connecting, makes more verbose on error --- src/library.c | 3 ++- src/player.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/library.c b/src/library.c index c42838a..8f06337 100644 --- a/src/library.c +++ b/src/library.c @@ -269,7 +269,8 @@ void library_init(instance_t* app) app->library.handle[0] = mvcp_init(app->library.handle[1]); if(mvcp_connect(app->library.handle[0]) != mvcp_ok) { - g_warning("library_init: failed to connect to server %s", app->players.host); + g_warning("library_init: failed to connect to server %s:%d", + app->players.host, app->library.port); return; }; diff --git a/src/player.c b/src/player.c index d7468b6..77b32f5 100644 --- a/src/player.c +++ b/src/player.c @@ -146,10 +146,10 @@ static void* player_thread_proc(void* data) for(; !player->app->f_exit;) { /* connect */ - if(mvcp_connect(handle->command) == mvcp_ok) + if(mvcp_connect(handle->command) != mvcp_ok) { - g_warning("player_thread_proc: failed to connect to server %s (player=%d, unit=%d)\n", - player->app->players.host, player->idx, player->unit); + g_warning("player_thread_proc: failed to connect to server %s:%d (player=%d, unit=%d)\n", + player->app->players.host, player->app->players.port, player->idx, player->unit); sleep(1); continue; }; -- 1.7.4.4