From cdc667e5eb84f5c3525d647d00736ab26a26ceaf Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 5 Jul 2012 09:58:43 +0200 Subject: [PATCH] Fix #1902 about bad status slots output --- bacula/src/dird/ua_label.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/ua_label.c b/bacula/src/dird/ua_label.c index a87af4b869..7dd1ecf2be 100644 --- a/bacula/src/dird/ua_label.c +++ b/bacula/src/dird/ua_label.c @@ -1277,27 +1277,26 @@ void status_slots(UAContext *ua, STORE *store_r) } } + memset(&mr, 0, sizeof(MEDIA_DBR)); bstrncpy(mr.VolumeName, vl->VolName, sizeof(mr.VolumeName)); - db_lock(ua->db); + if (mr.VolumeName[0] && db_get_media_record(ua->jcr, ua->db, &mr)) { memset(&pr, 0, sizeof(POOL_DBR)); pr.PoolId = mr.PoolId; if (!db_get_pool_record(ua->jcr, ua->db, &pr)) { strcpy(pr.Name, "?"); } - db_unlock(ua->db); /* Print information */ ua->send_msg(slot_hformat, vl->Slot, ((vl->Slot==mr.Slot)?' ':'*'), mr.VolumeName, mr.VolStatus, mr.MediaType, pr.Name); - continue; + } else { /* TODO: get information from catalog */ ua->send_msg(slot_hformat, vl->Slot, '*', mr.VolumeName, "?", "?", "?"); } - db_unlock(ua->db); } /* Display the rest of the autochanger -- 2.39.5