]> git.sur5r.net Git - bacula/bacula/commitdiff
Update dbd_get.c
authorKern Sibbald <kern@sibbald.com>
Wed, 23 Jul 2003 09:06:37 +0000 (09:06 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 23 Jul 2003 09:06:37 +0000 (09:06 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@647 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/cats/bdb_get.c

index 26306a21b3e2e5077bbce4d27fb1432d91102a38..0a111a1cdcf7f443604f2e287508e2f4d7d08efa 100644 (file)
@@ -30,8 +30,6 @@ Testing to do: (painful)
 - Figure out how to use ssh or stunnel to protect Bacula communications.
 
 For 1.31 release:
-- Increment DB version prior to releasing.
-- Turn off FULL_DEBUG prior to releasing.
 
 
 For 1.32:
@@ -1032,3 +1030,6 @@ Done: (see kernsdone for more)
 - Document using multiple Pools for daily rotating tapes.
 - Check if Incremental is working correctly when it looks for the previous Job 
   (Phil's problem).
+- Increment DB version prior to releasing.
+- Turn off FULL_DEBUG prior to releasing.
+
index ca0003f4210945b36e65dced746e114ba1655793..e152c227ba3416c0ff016666a6ae60fe8cac2aea 100644 (file)
@@ -247,13 +247,14 @@ int db_get_num_media_records(JCR *jcr, B_DB *mdb)
 }
 
 /*
- * This function returns a list of all the Media record ids.
+ * This function returns a list of all the Media record ids 
+ *  for a specified PoolId
  *  The caller must free ids if non-NULL.
  *
  *  Returns 0: on failure
  *         1: on success
  */
-int db_get_media_ids(JCR *jcr, B_DB *mdb, int *num_ids, uint32_t *ids[])
+int db_get_media_ids(JCR *jcr, B_DB *mdb, uint32_t PoolId, int *num_ids, uint32_t *ids[])
 {
    int i = 0;
    uint32_t *id;
@@ -277,7 +278,9 @@ int db_get_media_ids(JCR *jcr, B_DB *mdb, int *num_ids, uint32_t *ids[])
    *num_ids = mdb->control.MediaId;
    id = (uint32_t *)malloc(*num_ids * sizeof(uint32_t));
    while (fread(&omr, len, 1, mdb->mediafd) > 0) {
-      id[i++] = omr.MediaId;
+      if (PoolId == omr.MediaId) {
+        id[i++] = omr.MediaId;
+      }
    }
    *ids = id;
    db_unlock(mdb);