aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-12-10 10:24:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-12-10 10:24:47 +0000
commit400503ca8096bbbea57b6637988fe1f611007294 (patch)
tree5592dbe1e60a62baeeba51b983271307a1b96eb6 /URPM.xs
parente44272cb55f996cb35b3c49c4148057a4e58477c (diff)
downloadperl-URPM-400503ca8096bbbea57b6637988fe1f611007294.tar
perl-URPM-400503ca8096bbbea57b6637988fe1f611007294.tar.gz
perl-URPM-400503ca8096bbbea57b6637988fe1f611007294.tar.bz2
perl-URPM-400503ca8096bbbea57b6637988fe1f611007294.tar.xz
perl-URPM-400503ca8096bbbea57b6637988fe1f611007294.zip
simplify: use fdSize()
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs5
1 files changed, 1 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index e74e54a..3b6ce8a 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1225,14 +1225,11 @@ update_header(char *filename, URPM__Package pkg, int keep_all_tags, int vsflags)
ts = rpmtsCreate();
rpmtsSetVSFlags(ts, _RPMVSF_NOSIGNATURES | vsflags);
if (fd != NULL && rpmReadPackageFile(ts, fd, filename, &header) == 0 && header) {
- struct stat sb;
char *basename;
int_32 size;
basename = strrchr(filename, '/');
- fstat(fdFileno(fd), &sb);
- fdClose(fd);
- size = sb.st_size;
+ size = fdSize(fd);
headerAddEntry(header, FILENAME_TAG, RPM_STRING_TYPE, basename != NULL ? basename + 1 : filename, 1);
headerAddEntry(header, FILESIZE_TAG, RPM_INT32_TYPE, &size, 1);