From e3e02835413e32ff2f1ebe51f08e4c8ad96a93ac Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 23 Jul 2003 09:06:37 +0000 Subject: [PATCH] Update dbd_get.c git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@647 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 5 +++-- bacula/src/cats/bdb_get.c | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 26306a21b3..0a111a1cdc 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -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. + diff --git a/bacula/src/cats/bdb_get.c b/bacula/src/cats/bdb_get.c index ca0003f421..e152c227ba 100644 --- a/bacula/src/cats/bdb_get.c +++ b/bacula/src/cats/bdb_get.c @@ -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); -- 2.39.5