From: Kern Sibbald Date: Mon, 20 Sep 2010 19:30:08 +0000 (+0200) Subject: Fix bconsole bug with new BNET signals X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d766e447fca6be714302fa1a4427dc73509ef6be;p=bacula%2Fbacula Fix bconsole bug with new BNET signals --- diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 0b7eeb9c35..203cee38a1 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -31,7 +31,6 @@ * * Kern Sibbald, September MM * - * Version $Id$ */ #include "bacula.h" diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 7d637659c5..8f99ee8b93 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1342,8 +1342,8 @@ static int estimate_cmd(UAContext *ua, const char *cmd) bail_out: if (jcr->file_bsock) { - bnet_sig(jcr->file_bsock, BNET_TERMINATE); - bnet_close(jcr->file_bsock); + jcr->file_bsock->signal(BNET_TERMINATE); + jcr->file_bsock->close(); jcr->file_bsock = NULL; } return 1; diff --git a/bacula/src/dird/ua_input.c b/bacula/src/dird/ua_input.c index 2b16f50743..d264d10272 100644 --- a/bacula/src/dird/ua_input.c +++ b/bacula/src/dird/ua_input.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2001-2008 Free Software Foundation Europe e.V. + Copyright (C) 2001-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -31,7 +31,6 @@ * * Kern Sibbald, October MMI * - * Version $Id$ */ #include "bacula.h" @@ -56,11 +55,11 @@ int get_cmd(UAContext *ua, const char *prompt, bool subprompt) if (!sock || ua->batch) { /* No UA or batch mode */ return 0; } - if (!subprompt) { + if (!subprompt && ua->api) { sock->signal(BNET_TEXT_INPUT); } sock->fsend("%s", prompt); - if (subprompt) { + if (!ua->api || subprompt) { sock->signal(BNET_SUB_PROMPT); } for ( ;; ) {