mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
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:
parent
7467c8d3b6
commit
b028e08d35
@ -118,6 +118,9 @@ extern int gunzip_main(int argc, char **argv)
|
||||
/* Open input file */
|
||||
in_file = xfopen(if_name, "r");
|
||||
|
||||
/* set the buffer size */
|
||||
setvbuf(in_file, NULL, _IOFBF, 0x8000);
|
||||
|
||||
/* Get the time stamp on the input file. */
|
||||
if (stat(if_name, &stat_buf) < 0) {
|
||||
error_msg_and_die("Couldn't stat file %s", if_name);
|
||||
|
@ -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");
|
||||
}
|
||||
|
3
gunzip.c
3
gunzip.c
@ -118,6 +118,9 @@ extern int gunzip_main(int argc, char **argv)
|
||||
/* Open input file */
|
||||
in_file = xfopen(if_name, "r");
|
||||
|
||||
/* set the buffer size */
|
||||
setvbuf(in_file, NULL, _IOFBF, 0x8000);
|
||||
|
||||
/* Get the time stamp on the input file. */
|
||||
if (stat(if_name, &stat_buf) < 0) {
|
||||
error_msg_and_die("Couldn't stat file %s", if_name);
|
||||
|
@ -568,6 +568,9 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
|
||||
/* open the debian package to be worked on */
|
||||
deb_stream = wfopen(package_filename, "r");
|
||||
|
||||
/* set the buffer size */
|
||||
setvbuf(deb_stream, NULL, _IOFBF, 0x8000);
|
||||
|
||||
/* check ar magic */
|
||||
fread(ar_magic, 1, 8, deb_stream);
|
||||
if (strncmp(ar_magic,"!<arch>",7) != 0) {
|
||||
|
4
tar.c
4
tar.c
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user