diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2001-07-13 06:43:03 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2001-07-13 06:43:03 +0000 |
commit | b028e08d353f18d23c6b81d4ef260b1954adae72 (patch) | |
tree | c00537b1d8474c837312818bc48f6b822e8fb4d1 | |
parent | 7467c8d3b6a50e2cbd8db750963d40b420ad38d1 (diff) | |
download | busybox-w32-b028e08d353f18d23c6b81d4ef260b1954adae72.tar.gz busybox-w32-b028e08d353f18d23c6b81d4ef260b1954adae72.tar.bz2 busybox-w32-b028e08d353f18d23c6b81d4ef260b1954adae72.zip |
Move setvbuf calls from gz_open() to calling functions, setvbuf is only supposed to be called prior to opening the stream, glibc tolerates later use, uclibc doesnt.
-rw-r--r-- | archival/gunzip.c | 3 | ||||
-rw-r--r-- | archival/tar.c | 4 | ||||
-rw-r--r-- | gunzip.c | 3 | ||||
-rw-r--r-- | libbb/unarchive.c | 3 | ||||
-rw-r--r-- | tar.c | 4 |
5 files changed, 17 insertions, 0 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c index c4e84260b..430bc630e 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c | |||
@@ -118,6 +118,9 @@ extern int gunzip_main(int argc, char **argv) | |||
118 | /* Open input file */ | 118 | /* Open input file */ |
119 | in_file = xfopen(if_name, "r"); | 119 | in_file = xfopen(if_name, "r"); |
120 | 120 | ||
121 | /* set the buffer size */ | ||
122 | setvbuf(in_file, NULL, _IOFBF, 0x8000); | ||
123 | |||
121 | /* Get the time stamp on the input file. */ | 124 | /* Get the time stamp on the input file. */ |
122 | if (stat(if_name, &stat_buf) < 0) { | 125 | if (stat(if_name, &stat_buf) < 0) { |
123 | error_msg_and_die("Couldn't stat file %s", if_name); | 126 | error_msg_and_die("Couldn't stat file %s", if_name); |
diff --git a/archival/tar.c b/archival/tar.c index 31443ee22..cf65798ff 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -284,6 +284,10 @@ extern int tar_main(int argc, char **argv) | |||
284 | /* unzip tarFd in a seperate process */ | 284 | /* unzip tarFd in a seperate process */ |
285 | if (unzipFlag == TRUE) { | 285 | if (unzipFlag == TRUE) { |
286 | comp_file = fdopen(tarFd, "r"); | 286 | comp_file = fdopen(tarFd, "r"); |
287 | |||
288 | /* set the buffer size */ | ||
289 | setvbuf(comp_file, NULL, _IOFBF, 0x8000); | ||
290 | |||
287 | if ((tarFd = fileno(gz_open(comp_file, &pid))) == EXIT_FAILURE) { | 291 | if ((tarFd = fileno(gz_open(comp_file, &pid))) == EXIT_FAILURE) { |
288 | error_msg_and_die("Couldnt unzip file"); | 292 | error_msg_and_die("Couldnt unzip file"); |
289 | } | 293 | } |
@@ -118,6 +118,9 @@ extern int gunzip_main(int argc, char **argv) | |||
118 | /* Open input file */ | 118 | /* Open input file */ |
119 | in_file = xfopen(if_name, "r"); | 119 | in_file = xfopen(if_name, "r"); |
120 | 120 | ||
121 | /* set the buffer size */ | ||
122 | setvbuf(in_file, NULL, _IOFBF, 0x8000); | ||
123 | |||
121 | /* Get the time stamp on the input file. */ | 124 | /* Get the time stamp on the input file. */ |
122 | if (stat(if_name, &stat_buf) < 0) { | 125 | if (stat(if_name, &stat_buf) < 0) { |
123 | error_msg_and_die("Couldn't stat file %s", if_name); | 126 | error_msg_and_die("Couldn't stat file %s", if_name); |
diff --git a/libbb/unarchive.c b/libbb/unarchive.c index 5c5bb49f3..80dddb226 100644 --- a/libbb/unarchive.c +++ b/libbb/unarchive.c | |||
@@ -568,6 +568,9 @@ char *deb_extract(const char *package_filename, FILE *out_stream, | |||
568 | /* open the debian package to be worked on */ | 568 | /* open the debian package to be worked on */ |
569 | deb_stream = wfopen(package_filename, "r"); | 569 | deb_stream = wfopen(package_filename, "r"); |
570 | 570 | ||
571 | /* set the buffer size */ | ||
572 | setvbuf(deb_stream, NULL, _IOFBF, 0x8000); | ||
573 | |||
571 | /* check ar magic */ | 574 | /* check ar magic */ |
572 | fread(ar_magic, 1, 8, deb_stream); | 575 | fread(ar_magic, 1, 8, deb_stream); |
573 | if (strncmp(ar_magic,"!<arch>",7) != 0) { | 576 | if (strncmp(ar_magic,"!<arch>",7) != 0) { |
@@ -284,6 +284,10 @@ extern int tar_main(int argc, char **argv) | |||
284 | /* unzip tarFd in a seperate process */ | 284 | /* unzip tarFd in a seperate process */ |
285 | if (unzipFlag == TRUE) { | 285 | if (unzipFlag == TRUE) { |
286 | comp_file = fdopen(tarFd, "r"); | 286 | comp_file = fdopen(tarFd, "r"); |
287 | |||
288 | /* set the buffer size */ | ||
289 | setvbuf(comp_file, NULL, _IOFBF, 0x8000); | ||
290 | |||
287 | if ((tarFd = fileno(gz_open(comp_file, &pid))) == EXIT_FAILURE) { | 291 | if ((tarFd = fileno(gz_open(comp_file, &pid))) == EXIT_FAILURE) { |
288 | error_msg_and_die("Couldnt unzip file"); | 292 | error_msg_and_die("Couldnt unzip file"); |
289 | } | 293 | } |