From bf535624205e5d8a86fc91d631539b67ac140567 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 26 Feb 2005 16:01:45 +0000 Subject: [PATCH] Fix some bugs in SD with multiple files git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1846 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/acquire.c | 6 ++++-- bacula/src/stored/status.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 88e88c3e83..71c9811a3a 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -527,7 +527,8 @@ bool release_device(JCR *jcr) if (dev->can_read()) { dev->clear_read(); /* clear read bit */ - if (!dev_is_tape(dev) || !dev_cap(dev, CAP_ALWAYSOPEN)) { + /* Close if file or !CAP_ALWAYSOPEN */ + if (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN)) { offline_or_rewind_dev(dev); close_dev(dev); } @@ -553,7 +554,8 @@ bool release_device(JCR *jcr) dir_update_volume_info(dcr, false); /* send Volume info to Director */ } - if (dev->num_writers == 0 && dev->is_tape() && !dev_cap(dev, CAP_ALWAYSOPEN)) { + /* If no writers, close if file or !CAP_ALWAYS_OPEN */ + if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) { offline_or_rewind_dev(dev); close_dev(dev); } diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index 7ebbd19666..1430d82830 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -176,7 +176,7 @@ static void send_blocked_status(JCR *jcr, DEVICE *dev) bnet_fsend(user, _(" Device is BLOCKED waiting for mount of volume \"%s\".\n"), dcr->VolumeName); } else { - bnet_fsend(user, _(" Device is BLOCKED waiting for appendable media.\n")); + bnet_fsend(user, _(" Device is BLOCKED waiting for media.\n")); } break; case BST_DOING_ACQUIRE: @@ -218,6 +218,8 @@ static void send_blocked_status(JCR *jcr, DEVICE *dev) bnet_fsend(user, "%sSHORT ", dev->state & ST_SHORT ? "" : "!"); bnet_fsend(user, "%sMOUNTED ", dev->state & ST_MOUNTED ? "" : "!"); bnet_fsend(user, "\n"); + bnet_fsend(user, "num_writers=%d JobStatus=%c block=%d\nn", dev->num_writers, + jcr->JobStatus, dev->dev_blocked); bnet_fsend(user, _("Device parameters:\n")); bnet_fsend(user, "Archive name: %s Device name: %s\n", dev->dev_name, -- 2.39.5