summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2012-03-27 11:09:45 +0200
committerFlorian Festi <ffesti@redhat.com>2012-03-27 14:12:42 +0200
commit7c37d52941387c2bd23a7e84509d6c716b55e441 (patch)
tree21798dc7a7a70b0ecbc69128e0ac47842f20a48e
parent6492aa800f2bb40c4602f4b50e013797a1fb8549 (diff)
downloadrpm-7c37d52941387c2bd23a7e84509d6c716b55e441.tar.gz
rpm-7c37d52941387c2bd23a7e84509d6c716b55e441.tar.bz2
rpm-7c37d52941387c2bd23a7e84509d6c716b55e441.zip
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
-rw-r--r--lib/cpio.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/cpio.c b/lib/cpio.c
index 38321a1af..3e670afcf 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;