diff options
author | ewt <devnull@localhost> | 1998-06-14 16:04:00 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1998-06-14 16:04:00 +0000 |
commit | 119bcbf20499aab8d6421a00a16ae3ceb14c7683 (patch) | |
tree | aa8d4b308d92e52eee231441100fd15bf7fac8fb | |
parent | 835ae99566c22cf8bfac0f6d53e035faca385df8 (diff) | |
download | librpm-tizen-119bcbf20499aab8d6421a00a16ae3ceb14c7683.tar.gz librpm-tizen-119bcbf20499aab8d6421a00a16ae3ceb14c7683.tar.bz2 librpm-tizen-119bcbf20499aab8d6421a00a16ae3ceb14c7683.zip |
fssizes weren't behaving for pacakges w/o file list
CVS patchset: 2150
CVS date: 1998/06/14 16:04:00
-rw-r--r-- | lib/formats.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/formats.c b/lib/formats.c index 48052d672..43908af78 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -233,18 +233,29 @@ static int fssizesTag(Header h, int_32 * type, void ** data, int_32 * count, uint_32 * usages; int numFiles; - headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &filenames, NULL); - headerGetEntry(h, RPMTAG_FILESIZES, NULL, (void **) &filesizes, &numFiles); + if (headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &filenames, NULL)) + headerGetEntry(h, RPMTAG_FILESIZES, NULL, (void **) &filesizes, + &numFiles); + else + filenames = NULL; if (rpmGetFilesystemList(NULL, count)) { return 1; } + *type = RPM_INT32_TYPE; + *freeData = 1; + + if (!filenames) { + *data = usages = malloc(sizeof(usages) * (*count)); + memset(usages, 0, sizeof(usages) * (*count)); + + return 0; + } + if (rpmGetFilesystemUsage(filenames, filesizes, numFiles, &usages, 0)) return 1; - *type = RPM_INT32_TYPE; - *freeData = 1; *data = usages; return 0; |