]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1902 about bad status slots output
authorEric Bollengier <eric@baculasystems.com>
Thu, 5 Jul 2012 07:58:43 +0000 (09:58 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 5 Jul 2012 08:36:33 +0000 (10:36 +0200)
bacula/src/dird/ua_label.c

index a87af4b869914126c673807d40a831abec68bf9a..7dd1ecf2be726648f6c093292b77c57d2ed58829 100644 (file)
@@ -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