From 2c81586fd512736c9f056f7cab25d71d83596d3f Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Sun, 25 Apr 2004 10:51:40 +0000 Subject: [PATCH] Minor fixes. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1301 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/wx-console/console_thread.cpp | 22 +++++++++++++--------- bacula/src/wx-console/wxbutils.cpp | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bacula/src/wx-console/console_thread.cpp b/bacula/src/wx-console/console_thread.cpp index d459f2fa5c..3e59546983 100644 --- a/bacula/src/wx-console/console_thread.cpp +++ b/bacula/src/wx-console/console_thread.cpp @@ -57,6 +57,12 @@ console_thread::~console_thread() { bnet_close(UA_sock); UA_sock = NULL; } + if (WSACleanup() == 0) { + //csprint("Windows sockets cleaned up successfully...\n"); + } + else { + csprint("Error while cleaning up windows sockets...\n"); + } } /* @@ -68,9 +74,8 @@ void* console_thread::Entry() { } else { csprint("Error while initializing windows sockets...\n"); - return 0; } - + csprint("Connecting...\n"); init_stack_dump(); @@ -86,10 +91,14 @@ void* console_thread::Entry() { UnlockRes(); memset(&jcr, 0, sizeof(jcr)); + + jcr.dequeuing = 1; /* TODO: catch messages */ UA_sock = bnet_connect(&jcr, 3, 3, "Director daemon", dir->address, NULL, dir->DIRport, 0); if (UA_sock == NULL) { csprint("Failed to connect to the director\n"); + csprint(NULL, CS_END); + csprint(NULL, CS_DISCONNECTED); return NULL; } @@ -99,6 +108,8 @@ void* console_thread::Entry() { if (!authenticate_director(&jcr, dir, NULL)) { csprint("ERR="); csprint(UA_sock->msg); + csprint(NULL, CS_END); + csprint(NULL, CS_DISCONNECTED); return NULL; } @@ -147,13 +158,6 @@ void* console_thread::Entry() { UA_sock = NULL; - if (WSACleanup() == 0) { - //csprint("Windows sockets cleaned up successfully...\n"); - } - else { - csprint("Error while cleaning up windows sockets...\n"); - } - return 0; } diff --git a/bacula/src/wx-console/wxbutils.cpp b/bacula/src/wx-console/wxbutils.cpp index 0c1c65b16c..ab69ad2caf 100644 --- a/bacula/src/wx-console/wxbutils.cpp +++ b/bacula/src/wx-console/wxbutils.cpp @@ -164,7 +164,7 @@ bool wxbPromptParser::Analyse(wxString str, int status) { choices->Add(""); /* index 0 is never used by multiple choice questions */ } - if (choices->GetCount() != num) { /* new choice has begun */ + if ((long)choices->GetCount() != num) { /* new choice has begun */ delete choices; choices = new wxArrayString(num); choices->Add("", num); /* fill until this number */ -- 2.39.5