diff options
author | jbj <devnull@localhost> | 2001-04-29 01:05:43 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-04-29 01:05:43 +0000 |
commit | 3b5820c4205e440d9aad5c5d626721ee30b12292 (patch) | |
tree | b1f0a694903aef1dd937539e1b06c8b0947fb67c /lib/fs.c | |
parent | 6a0524ed57548de92daa4b6cf8ee9d2ab39d7a42 (diff) | |
download | rpm-3b5820c4205e440d9aad5c5d626721ee30b12292.tar.gz rpm-3b5820c4205e440d9aad5c5d626721ee30b12292.tar.bz2 rpm-3b5820c4205e440d9aad5c5d626721ee30b12292.zip |
- globalize _free(3) wrapper in rpmlib.h, consistent usage throughout.
- internalize locale insensitive ctype(3) in rpmio.h
- boring lclint annotations and fiddles.
CVS patchset: 4721
CVS date: 2001/04/29 01:05:43
Diffstat (limited to 'lib/fs.c')
-rw-r--r-- | lib/fs.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -22,9 +22,8 @@ void freeFilesystems(void) if (filesystems) { int i; for (i = 0; i < numFilesystems; i++) - free((void *)filesystems[i].mntPoint); - free(filesystems); - filesystems = NULL; + filesystems[i].mntPoint = _free(filesystems[i].mntPoint); + filesystems = _free(filesystems); } if (fsnames) { #if 0 /* XXX leak/segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" */ @@ -286,8 +285,8 @@ int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes, int numFiles if (errno != ENOENT) { rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), buf, strerror(errno)); - free((void *)sourceDir); - free(usages); + sourceDir = _free(sourceDir); + usages = _free(usages); return 1; } @@ -307,8 +306,8 @@ int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes, int numFiles if (j == numFilesystems) { rpmError(RPMERR_BADDEV, _("file %s is on an unknown device\n"), buf); - free((void *)sourceDir); - free(usages); + sourceDir = _free(sourceDir); + usages = _free(usages); return 1; } @@ -321,9 +320,12 @@ int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes, int numFiles usages[lastfs] += fssizes[i]; } - if (sourceDir) free((void *)sourceDir); + sourceDir = _free(sourceDir); - *usagesPtr = usages; + if (usagesPtr) + *usagesPtr = usages; + else + usages = _free(usages); return 0; } |