]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/next_vol.c
kes Fix %g in filename returned by SQL for browse tree reported by
[bacula/bacula] / bacula / src / dird / next_vol.c
index 1a4f8b4a7e59b5b8432b83f5f4761a3fc4348991..40722bef872b7307e4b17bebd691f62218b300c7 100644 (file)
@@ -386,16 +386,8 @@ bool get_scratch_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
             goto bail_out;
          }
 
-         /*
-          * Get *full* media record to return as db_find_next_volume does
-          *   not return everything .
-          */
-         mr->MediaId = smr.MediaId;
-         if (!db_get_media_record(jcr, jcr->db, mr)) {
-            Jmsg(jcr, M_WARNING, 0, _("Unable to get Volume record: ERR=%s"),
-                 db_strerror(jcr->db));
-            goto bail_out;
-         }
+         memcpy(mr, &smr, sizeof(MEDIA_DBR)); 
+
          /* Set default parameters from current pool */
          set_pool_dbr_defaults_in_media_dbr(mr, &pr);
 
@@ -405,7 +397,7 @@ bool get_scratch_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
           *   RecyclePoolId.
           */
          bstrncpy(mr->VolStatus, smr.VolStatus, sizeof(smr.VolStatus));
-         mr.RecyclePoolId = smr.RecyclePoolId;
+         mr->RecyclePoolId = smr.RecyclePoolId;
 
          if (!db_update_media_record(jcr, jcr->db, mr)) {
             Jmsg(jcr, M_WARNING, 0, _("Failed to move Scratch Volume. ERR=%s\n"),