summaryrefslogtreecommitdiffstats
path: root/isys/uncpio.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-11-30 01:56:37 +0000
committerErik Troan <ewt@redhat.com>2001-11-30 01:56:37 +0000
commit9eef14f4a8dbef0a99f6815882fc45fc406e3c89 (patch)
treef80b94938977f014c6dbdb93b1d6e93b506025e6 /isys/uncpio.c
parent9225933a820f89b9e3d7091c2fde5030419ea1c9 (diff)
downloadanaconda-9eef14f4a8dbef0a99f6815882fc45fc406e3c89.tar.gz
anaconda-9eef14f4a8dbef0a99f6815882fc45fc406e3c89.tar.xz
anaconda-9eef14f4a8dbef0a99f6815882fc45fc406e3c89.zip
put back bits removed for initial port to gzlib
Diffstat (limited to 'isys/uncpio.c')
-rw-r--r--isys/uncpio.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/isys/uncpio.c b/isys/uncpio.c
index 2bbd1e6b0..a90d0ddc3 100644
--- a/isys/uncpio.c
+++ b/isys/uncpio.c
@@ -110,10 +110,8 @@ static inline int padoutfd(struct ourfd * fd, size_t * where, int modulo) {
amount = (modulo - *where % modulo) % modulo;
*where += amount;
-#if 0
- if (gunzip_write(fd->fd, buf, amount) != amount)
+ if (gzip_write(fd->fd, buf, amount) != amount)
return CPIOERR_WRITE_FAILED;
-#endif
return 0;
}
@@ -157,8 +155,7 @@ static int getNextHeader(struct ourfd * fd, struct cpioHeader * chPtr,
if (strncmp(CPIO_CRC_MAGIC, physHeader.magic, strlen(CPIO_CRC_MAGIC)) &&
strncmp(CPIO_NEWC_MAGIC, physHeader.magic, strlen(CPIO_NEWC_MAGIC)))
- /*return CPIOERR_BAD_MAGIC;*/
- abort();
+ return CPIOERR_BAD_MAGIC;
GET_NUM_FIELD(physHeader.inode, chPtr->inode);
GET_NUM_FIELD(physHeader.mode, chPtr->mode);
@@ -704,22 +701,19 @@ static int copyFile(struct ourfd * inFd, struct ourfd * outFd,
amount = strlen(chp->path) + 1;
memcpy(pHdr->magic, CPIO_NEWC_MAGIC, sizeof(pHdr->magic));
-#if 0
- gunzip_write(outFd->fd, pHdr, PHYS_HDR_SIZE);
- gunzip_write(outFd->fd, chp->path, amount);
-#endif
+
+ gzip_write(outFd->fd, pHdr, PHYS_HDR_SIZE);
+ gzip_write(outFd->fd, chp->path, amount);
outFd->pos += PHYS_HDR_SIZE + amount;
padoutfd(outFd, &outFd->pos, 4);
-#if 0
while (size) {
amount = ourread(inFd, buf, size > sizeof(buf) ? sizeof(buf) : size);
- gunzip_write(outFd->fd, buf, amount);
+ gzip_write(outFd->fd, buf, amount);
size -= amount;
}
-#endif
outFd->pos += chp->size;
@@ -770,10 +764,8 @@ int myCpioFilterArchive(gzFile inStream, gzFile outStream, char ** patterns) {
memcpy(pHeader.magic, CPIO_NEWC_MAGIC, sizeof(pHeader.magic));
memcpy(pHeader.nlink, "00000001", 8);
memcpy(pHeader.namesize, "0000000b", 8);
- #if 0
- gunzip_write(outFd.fd, &pHeader, PHYS_HDR_SIZE);
- gunzip_write(outFd.fd, "TRAILER!!!", 11);
- #endif
+ gzip_write(outFd.fd, &pHeader, PHYS_HDR_SIZE);
+ gzip_write(outFd.fd, "TRAILER!!!", 11);
outFd.pos += PHYS_HDR_SIZE + 11;