summaryrefslogtreecommitdiff
path: root/rpmio/rpmio.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-15 11:33:18 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-15 11:33:18 +0300
commited6ed5c1ce0854f1b8956a66e8a429c9d5ff3948 (patch)
tree1473e35559cb7abf9735a6197e96f351aa5c5d08 /rpmio/rpmio.c
parentaa2ae3803cc38db786a662d70826a0131293b674 (diff)
downloadrpm-ed6ed5c1ce0854f1b8956a66e8a429c9d5ff3948.tar.gz
rpm-ed6ed5c1ce0854f1b8956a66e8a429c9d5ff3948.tar.bz2
rpm-ed6ed5c1ce0854f1b8956a66e8a429c9d5ff3948.zip
Add ftell() clone to FD_t
Diffstat (limited to 'rpmio/rpmio.c')
-rw-r--r--rpmio/rpmio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 94747aab1..1bc79dacb 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -2052,6 +2052,21 @@ int Fflush(FD_t fd)
return 0;
}
+off_t Ftell(FD_t fd)
+{
+ FDIO_t iot;
+ off_t pos = -2; /* assume not implemented */
+
+ if (fd == NULL) return -1;
+ iot = fdGetIo(fd);
+ /* this wont work correctly for compressed types */
+ if (iot == fpio || iot == fdio || iot == ufdio) {
+ pos = lseek(Fileno(fd), 0, SEEK_CUR);
+ }
+
+ return pos;
+}
+
int Ferror(FD_t fd)
{
int i, rc = 0;