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.

This commit is contained in:
Glenn L McGrath
2001-07-13 06:43:03 +00:00
parent 7467c8d3b6
commit b028e08d35
5 changed files with 17 additions and 0 deletions

View File

@@ -284,6 +284,10 @@ extern int tar_main(int argc, char **argv)
/* unzip tarFd in a seperate process */
if (unzipFlag == TRUE) {
comp_file = fdopen(tarFd, "r");
/* set the buffer size */
setvbuf(comp_file, NULL, _IOFBF, 0x8000);
if ((tarFd = fileno(gz_open(comp_file, &pid))) == EXIT_FAILURE) {
error_msg_and_die("Couldnt unzip file");
}