summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewt <devnull@localhost>1998-06-14 16:04:00 +0000
committerewt <devnull@localhost>1998-06-14 16:04:00 +0000
commit119bcbf20499aab8d6421a00a16ae3ceb14c7683 (patch)
treeaa8d4b308d92e52eee231441100fd15bf7fac8fb
parent835ae99566c22cf8bfac0f6d53e035faca385df8 (diff)
downloadlibrpm-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.c19
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;