From: Eric Bollengier Date: Thu, 5 Jul 2012 07:58:43 +0000 (+0200) Subject: Fix #1902 about bad status slots output X-Git-Tag: Release-7.0.0~152 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b62433cecb65be9938660a881e08e790a5f34827;p=bacula%2Fbacula Fix #1902 about bad status slots output --- 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