aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-03-28 23:57:51 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-03-28 23:57:51 +0000
commitae8ad35590ad2b82232920c94a0e2317e4008552 (patch)
tree95fa4c0a84095894fd214d59cdb7219e7185aa03
parente0a7f917c293fbde421fbdffc9cb3dd47ff14ee2 (diff)
downloadbusybox-w32-ae8ad35590ad2b82232920c94a0e2317e4008552.tar.gz
busybox-w32-ae8ad35590ad2b82232920c94a0e2317e4008552.tar.bz2
busybox-w32-ae8ad35590ad2b82232920c94a0e2317e4008552.zip
Fixes from Robert Kaiser
-rw-r--r--archival/gunzip.c10
-rw-r--r--archival/tar.c9
-rw-r--r--gunzip.c10
-rw-r--r--tar.c9
4 files changed, 18 insertions, 20 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 0af6adbf7..93f7c351e 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -125,14 +125,13 @@ unsigned short mask_bits[] = {
125//static int error_number = 0; 125//static int error_number = 0;
126/* ======================================================================== 126/* ========================================================================
127 * Signal and error handler. 127 * Signal and error handler.
128 */
128 129
129static void abort_gzip() 130static void abort_gzip()
130{ 131{
131 error_msg("gzip aborted\n"); 132 error_msg("gzip aborted\n");
132// exit(ERROR); 133 exit(ERROR);
133 return;
134} 134}
135*/
136 135
137static void make_crc_table() 136static void make_crc_table()
138{ 137{
@@ -918,7 +917,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
918 in_file = l_in_file; 917 in_file = l_in_file;
919 out_file = l_out_file; 918 out_file = l_out_file;
920 919
921/* if (signal(SIGINT, SIG_IGN) != SIG_IGN) { 920 if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
922 (void) signal(SIGINT, (sig_type) abort_gzip); 921 (void) signal(SIGINT, (sig_type) abort_gzip);
923 } 922 }
924#ifdef SIGTERM 923#ifdef SIGTERM
@@ -931,7 +930,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
931 (void) signal(SIGHUP, (sig_type) abort_gzip); 930 (void) signal(SIGHUP, (sig_type) abort_gzip);
932 } 931 }
933#endif 932#endif
934*/ 933
935 /* Allocate all global buffers (for DYN_ALLOC option) */ 934 /* Allocate all global buffers (for DYN_ALLOC option) */
936 window = xmalloc((size_t)(((2L*WSIZE)+1L)*sizeof(unsigned char))); 935 window = xmalloc((size_t)(((2L*WSIZE)+1L)*sizeof(unsigned char)));
937 outcnt = 0; 936 outcnt = 0;
@@ -1022,7 +1021,6 @@ extern int gz_open(FILE *compressed_file, int *pid)
1022{ 1021{
1023 int unzip_pipe[2]; 1022 int unzip_pipe[2];
1024 1023
1025// signal(SIGCHLD, abort_gzip);
1026 if (pipe(unzip_pipe)!=0) { 1024 if (pipe(unzip_pipe)!=0) {
1027 error_msg("pipe error"); 1025 error_msg("pipe error");
1028 return(EXIT_FAILURE); 1026 return(EXIT_FAILURE);
diff --git a/archival/tar.c b/archival/tar.c
index 9be63ced8..fb8d84446 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -292,12 +292,13 @@ extern int tar_main(int argc, char **argv)
292 status = readTarFile(tarFd, extractFlag, listFlag, tostdoutFlag, 292 status = readTarFile(tarFd, extractFlag, listFlag, tostdoutFlag,
293 verboseFlag, extractList, excludeList); 293 verboseFlag, extractList, excludeList);
294 close(tarFd); 294 close(tarFd);
295 }
296
297#ifdef BB_FEATURE_TAR_GZIP 295#ifdef BB_FEATURE_TAR_GZIP
298 gz_close(pid); 296 if (unzipFlag == TRUE) {
299 fclose(comp_file); 297 gz_close(pid);
298 fclose(comp_file);
299 }
300#endif 300#endif
301 }
301 302
302 if (status == TRUE) 303 if (status == TRUE)
303 return EXIT_SUCCESS; 304 return EXIT_SUCCESS;
diff --git a/gunzip.c b/gunzip.c
index 0af6adbf7..93f7c351e 100644
--- a/gunzip.c
+++ b/gunzip.c
@@ -125,14 +125,13 @@ unsigned short mask_bits[] = {
125//static int error_number = 0; 125//static int error_number = 0;
126/* ======================================================================== 126/* ========================================================================
127 * Signal and error handler. 127 * Signal and error handler.
128 */
128 129
129static void abort_gzip() 130static void abort_gzip()
130{ 131{
131 error_msg("gzip aborted\n"); 132 error_msg("gzip aborted\n");
132// exit(ERROR); 133 exit(ERROR);
133 return;
134} 134}
135*/
136 135
137static void make_crc_table() 136static void make_crc_table()
138{ 137{
@@ -918,7 +917,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
918 in_file = l_in_file; 917 in_file = l_in_file;
919 out_file = l_out_file; 918 out_file = l_out_file;
920 919
921/* if (signal(SIGINT, SIG_IGN) != SIG_IGN) { 920 if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
922 (void) signal(SIGINT, (sig_type) abort_gzip); 921 (void) signal(SIGINT, (sig_type) abort_gzip);
923 } 922 }
924#ifdef SIGTERM 923#ifdef SIGTERM
@@ -931,7 +930,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
931 (void) signal(SIGHUP, (sig_type) abort_gzip); 930 (void) signal(SIGHUP, (sig_type) abort_gzip);
932 } 931 }
933#endif 932#endif
934*/ 933
935 /* Allocate all global buffers (for DYN_ALLOC option) */ 934 /* Allocate all global buffers (for DYN_ALLOC option) */
936 window = xmalloc((size_t)(((2L*WSIZE)+1L)*sizeof(unsigned char))); 935 window = xmalloc((size_t)(((2L*WSIZE)+1L)*sizeof(unsigned char)));
937 outcnt = 0; 936 outcnt = 0;
@@ -1022,7 +1021,6 @@ extern int gz_open(FILE *compressed_file, int *pid)
1022{ 1021{
1023 int unzip_pipe[2]; 1022 int unzip_pipe[2];
1024 1023
1025// signal(SIGCHLD, abort_gzip);
1026 if (pipe(unzip_pipe)!=0) { 1024 if (pipe(unzip_pipe)!=0) {
1027 error_msg("pipe error"); 1025 error_msg("pipe error");
1028 return(EXIT_FAILURE); 1026 return(EXIT_FAILURE);
diff --git a/tar.c b/tar.c
index 9be63ced8..fb8d84446 100644
--- a/tar.c
+++ b/tar.c
@@ -292,12 +292,13 @@ extern int tar_main(int argc, char **argv)
292 status = readTarFile(tarFd, extractFlag, listFlag, tostdoutFlag, 292 status = readTarFile(tarFd, extractFlag, listFlag, tostdoutFlag,
293 verboseFlag, extractList, excludeList); 293 verboseFlag, extractList, excludeList);
294 close(tarFd); 294 close(tarFd);
295 }
296
297#ifdef BB_FEATURE_TAR_GZIP 295#ifdef BB_FEATURE_TAR_GZIP
298 gz_close(pid); 296 if (unzipFlag == TRUE) {
299 fclose(comp_file); 297 gz_close(pid);
298 fclose(comp_file);
299 }
300#endif 300#endif
301 }
301 302
302 if (status == TRUE) 303 if (status == TRUE)
303 return EXIT_SUCCESS; 304 return EXIT_SUCCESS;