]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/bsr.c
Fix and document new queries
[bacula/bacula] / bacula / src / dird / bsr.c
index a924ff13672e497e0c6d2d435586113c1f8c19be..96d30c0ca3dd24f6890a6fb78663fb88ad6c8eec 100644 (file)
@@ -176,6 +176,10 @@ bool complete_bsr(UAContext *ua, RBSR *bsr)
       }
       bsr->VolSessionId = jr.VolSessionId;
       bsr->VolSessionTime = jr.VolSessionTime;
+      if (jr.JobFiles == 0) {      /* zero files is OK, not an error, but */
+         bsr->VolCount = 0;        /*   there are no volumes */
+         continue;
+      }
       if ((bsr->VolCount=db_get_job_volume_parameters(ua->jcr, ua->db, bsr->JobId,
            &(bsr->VolParams))) == 0) {
          ua->error_msg(_("Unable to get Job Volume Parameters. ERR=%s\n"), db_strerror(ua->db));
@@ -347,7 +351,7 @@ static uint32_t write_bsr_item(RBSR *bsr, UAContext *ua,
          find_storage_resource(ua, rx, bsr->VolParams[i].Storage,
                                        bsr->VolParams[i].MediaType);
       }
-//    fprintf(fd, "Storage=\"%s\"\n", bsr->VolParams[i].Storage);
+      fprintf(fd, "Storage=\"%s\"\n", bsr->VolParams[i].Storage);
       fprintf(fd, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName);
       fprintf(fd, "MediaType=\"%s\"\n", bsr->VolParams[i].MediaType);
       if (bsr->fileregex) {