diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-15 11:33:18 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-15 11:33:18 +0300 |
commit | ed6ed5c1ce0854f1b8956a66e8a429c9d5ff3948 (patch) | |
tree | 1473e35559cb7abf9735a6197e96f351aa5c5d08 /rpmio/rpmio.c | |
parent | aa2ae3803cc38db786a662d70826a0131293b674 (diff) | |
download | rpm-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.c | 15 |
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; |