summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-06-09 11:33:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-06-09 11:33:38 +0300
commitefe91c1c3799fc77b0747e84715eb784e2f4b80d (patch)
tree0999ff42aba0c81039b9a5142a6704e37bd98b02
parente07c86c6292d7b490abe393c90714cacc833820f (diff)
downloadlibrpm-tizen-efe91c1c3799fc77b0747e84715eb784e2f4b80d.tar.gz
librpm-tizen-efe91c1c3799fc77b0747e84715eb784e2f4b80d.tar.bz2
librpm-tizen-efe91c1c3799fc77b0747e84715eb784e2f4b80d.zip
Support set append in dbiCursorGetToSet()
- If called with an existing set, results are appended. Otherwise return a newly allocated set.
-rw-r--r--lib/rpmdb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index e86147b66..56e274081 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -465,7 +465,15 @@ static int dbiCursorGetToSet(dbiCursor dbc, const char *keyp, size_t keylen,
rc = dbiCursorGet(dbc, &key, &data, cflags);
if (rc == 0) {
- dbt2set(dbi, &data, set);
+ dbiIndexSet newset = NULL;
+ dbt2set(dbi, &data, &newset);
+ if (*set == NULL) {
+ *set = newset;
+ } else {
+ dbiAppendSet(*set, newset->recs, newset->count,
+ sizeof(*(newset->recs)), 0);
+ dbiIndexSetFree(newset);
+ }
} else if (rc != DB_NOTFOUND) {
rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index: %s\n"),