summaryrefslogtreecommitdiff
path: root/archival/gunzip.c
diff options
context:
space:
mode:
authorGlenn L McGrath2001-03-28 07:27:26 +0000
committerGlenn L McGrath2001-03-28 07:27:26 +0000
commit018e9e6799ec34d2793c7b16f52e39cd9206861b (patch)
tree6d33d3c39b838f96cd47b0247b1696f9337d87b1 /archival/gunzip.c
parentee79ca1ba69b5b43cd0c2e3b6d2eb20a4a5a0f8e (diff)
downloadbusybox-018e9e6799ec34d2793c7b16f52e39cd9206861b.zip
busybox-018e9e6799ec34d2793c7b16f52e39cd9206861b.tar.gz
Fix tar -z, calls gz_open now
Diffstat (limited to 'archival/gunzip.c')
-rw-r--r--archival/gunzip.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index e9f7648..9d81031 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -918,7 +918,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
in_file = l_in_file;
out_file = l_out_file;
- if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
+/* if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
(void) signal(SIGINT, (sig_type) abort_gzip);
}
#ifdef SIGTERM
@@ -931,7 +931,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
(void) signal(SIGHUP, (sig_type) abort_gzip);
}
#endif
-
+*/
/* Allocate all global buffers (for DYN_ALLOC option) */
window = xmalloc((size_t)(((2L*WSIZE)+1L)*sizeof(unsigned char)));
outcnt = 0;
@@ -1018,33 +1018,32 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
return 0;
}
-extern FILE *gz_open(FILE *compressed_file, int *pid)
+extern int gz_open(FILE *compressed_file, int *pid)
{
int unzip_pipe[2];
- signal(SIGCHLD, abort_gzip);
+// signal(SIGCHLD, abort_gzip);
if (pipe(unzip_pipe)!=0) {
error_msg("pipe error");
- return NULL;
+ return(EXIT_FAILURE);
}
if ((*pid = fork()) == -1) {
error_msg("fork failured");
- return NULL;
+ return(EXIT_FAILURE);
}
if (*pid==0) {
/* child process */
close(unzip_pipe[0]);
unzip(compressed_file, fdopen(unzip_pipe[1], "w"));
-// printf("finished unzipping\n");
+ printf("finished unzipping\n");
fflush(NULL);
-// printf("fluched\n");
fclose(compressed_file);
close(unzip_pipe[1]);
exit(EXIT_SUCCESS);
}
close(unzip_pipe[1]);
- return (fdopen(unzip_pipe[0], "r"));
+ return(unzip_pipe[0]);
}
extern void gz_close(int gunzip_pid)