aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2009-08-06 05:32:35 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2009-08-06 05:32:35 +0000
commitedd10e245408c33ea9d76ebf56765e960a04b10f (patch)
tree90a8b775befffc0a676a5c138dde02e095288b1c
parente81ac4474af636cfecf56d4def66e0511a828b6c (diff)
downloadperl-URPM-edd10e245408c33ea9d76ebf56765e960a04b10f.tar
perl-URPM-edd10e245408c33ea9d76ebf56765e960a04b10f.tar.gz
perl-URPM-edd10e245408c33ea9d76ebf56765e960a04b10f.tar.bz2
perl-URPM-edd10e245408c33ea9d76ebf56765e960a04b10f.tar.xz
perl-URPM-edd10e245408c33ea9d76ebf56765e960a04b10f.zip
make a rpm.org wrapper function for Fstat()
-rw-r--r--URPM.xs8
-rw-r--r--rpm5compat.h5
2 files changed, 5 insertions, 8 deletions
diff --git a/URPM.xs b/URPM.xs
index 3aa46d4..b2ca537 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1372,18 +1372,10 @@ update_header(char *filename, URPM__Package pkg, __attribute__((unused)) int kee
rpmtsSetVSFlags(ts, _RPMVSF_NOSIGNATURES | vsflags);
if (fd != NULL && rpmReadPackageFile(ts, fd, filename, &header) == 0 && header) {
char *basename;
-#ifndef RPM_ORG
struct stat sb;
-#else
- int32_t size;
-#endif
basename = strrchr(filename, '/');
-#ifndef RPM_ORG
Fstat(fd, &sb);
-#else
- size = fdSize(fd);
-#endif
Fclose(fd);
/* this is only kept for compatibility with older distros
diff --git a/rpm5compat.h b/rpm5compat.h
index e98d343..2fbcef2 100644
--- a/rpm5compat.h
+++ b/rpm5compat.h
@@ -128,4 +128,9 @@ static int rpmEVRcompare(const EVR_t a, const EVR_t b) {
return rc;
}
+static inline int Fstat(FD_t fd, struct stat * st)
+{
+ return fstat(Fileno(fd), st);
+}
+
#endif /* H_RPM5COMPAT */