diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-12-10 10:24:47 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-12-10 10:24:47 +0000 |
commit | 400503ca8096bbbea57b6637988fe1f611007294 (patch) | |
tree | 5592dbe1e60a62baeeba51b983271307a1b96eb6 | |
parent | e44272cb55f996cb35b3c49c4148057a4e58477c (diff) | |
download | perl-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()
-rw-r--r-- | URPM.xs | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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); |