From 26a0d9a9454ef2075079c74844297e61cd5e0293 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Fri, 13 Jul 2001 06:49:18 +0000 Subject: [PATCH] Call setvbuf from here isntead of gz_open for compatability with uclibc --- archival/rpm2cpio.c | 3 +++ rpm2cpio.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index 8d4ca84dc..45c3ffb17 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c @@ -74,6 +74,8 @@ extern int rpm2cpio_main(int argc, char **argv) } else { rpmfile = fopen(argv[1], "r"); if (!rpmfile) perror_msg_and_die("Can't open rpm file"); + /* set the buffer size */ + setvbuf(rpmfile, NULL, _IOFBF, 0x8000); } fread (&lead, sizeof(struct rpm_lead), 1, rpmfile); @@ -85,6 +87,7 @@ extern int rpm2cpio_main(int argc, char **argv) skip_header(rpmfile); cpiofile = gz_open(rpmfile, &gunzip_pid); + copyfd(fileno(cpiofile), fileno(stdout)); gz_close(gunzip_pid); fclose(rpmfile); diff --git a/rpm2cpio.c b/rpm2cpio.c index 8d4ca84dc..45c3ffb17 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -74,6 +74,8 @@ extern int rpm2cpio_main(int argc, char **argv) } else { rpmfile = fopen(argv[1], "r"); if (!rpmfile) perror_msg_and_die("Can't open rpm file"); + /* set the buffer size */ + setvbuf(rpmfile, NULL, _IOFBF, 0x8000); } fread (&lead, sizeof(struct rpm_lead), 1, rpmfile); @@ -85,6 +87,7 @@ extern int rpm2cpio_main(int argc, char **argv) skip_header(rpmfile); cpiofile = gz_open(rpmfile, &gunzip_pid); + copyfd(fileno(cpiofile), fileno(stdout)); gz_close(gunzip_pid); fclose(rpmfile);