From: Florian Festi Date: Tue, 27 Mar 2012 09:09:45 +0000 (+0200) Subject: Remove Fseek() code from rpmcpioHeaderRead for now X-Git-Tag: tznext/4.11.0.1.tizen20130304~611 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c37d52941387c2bd23a7e84509d6c716b55e441;p=tools%2Flibrpm-tizen.git Remove Fseek() code from rpmcpioHeaderRead for now Fseek() does not return a proper error code. This needs to be fixed before we can use it as most comprssed files do not support seeking and we need to be able to detect this reliably --- diff --git a/lib/cpio.c b/lib/cpio.c index 38321a1..3e670af 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -252,20 +252,16 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, struct stat * st) /* Move to next file */ if (cpio->fileend != cpio->offset) { - //if (Fseek(cpio->fd, cpio->fileend-cpio->offset, SEEK_CUR)) - { - /* XXX try using Fseek() - which is currently broken */ - char buf[8*BUFSIZ]; - while (cpio->fileend != cpio->offset) { - read = cpio->fileend - cpio->offset > 8*BUFSIZ ? 8*BUFSIZ : cpio->fileend - cpio->offset; - if (rpmcpioRead(cpio, &buf, read) != read) { - return CPIOERR_READ_FAILED; - } + /* XXX try using Fseek() - which is currently broken */ + char buf[8*BUFSIZ]; + while (cpio->fileend != cpio->offset) { + read = cpio->fileend - cpio->offset > 8*BUFSIZ ? 8*BUFSIZ : cpio->fileend - cpio->offset; + if (rpmcpioRead(cpio, &buf, read) != read) { + return CPIOERR_READ_FAILED; } - //} else { /* seek worked */ - //cpio->offset = cpio->fileend; } } + rc = rpmcpioReadPad(cpio); if (rc) return rc;