From ff5609b0181d033d7920bf1a517023f1bf18ed0f Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Fri, 7 Jan 2011 10:52:32 +0100 Subject: [PATCH] Fix adc admin client main loop so that it exits on error. --- src/tools/admin.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tools/admin.c b/src/tools/admin.c index 225cbb2..59dd819 100644 --- a/src/tools/admin.c +++ b/src/tools/admin.c @@ -26,6 +26,7 @@ static int handle(struct ADC_client* client, enum ADC_client_callback_type type, case ADC_CLIENT_PASSWORD_REQ: puts("*** Requesting password."); + break; case ADC_CLIENT_LOGGED_IN: puts("*** Logged in."); @@ -80,10 +81,7 @@ int main(int argc, char** argv) ADC_client_set_callback(&client, handle); ADC_client_connect(&client, argv[1]); - while (running) - { - net_backend_process(); - } + while (running && net_backend_process()) { } ADC_client_destroy(&client); net_destroy();