From 75fcdfd825066b665ee322c669a231ff5e555862 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 20 Sep 2010 21:30:08 +0200 Subject: [PATCH] Fix bconsole bug with new BNET signals --- bacula/src/console/console.c | 3 +-- bacula/src/dird/ua_cmds.c | 4 ++-- bacula/src/dird/ua_input.c | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 04e51abf81..9f6360cf8e 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 ( ;; ) { -- 2.39.2