aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/bunzip2.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index d24f383cf..fd639a4e8 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -132,7 +132,6 @@
132 132
133#define BZ_MAX_CODE_LEN 23 133#define BZ_MAX_CODE_LEN 23
134#define OM_TEST 3 134#define OM_TEST 3
135#define SM_F2F 3
136 135
137typedef struct { 136typedef struct {
138 char *next_in; 137 char *next_in;
@@ -343,24 +342,6 @@ static unsigned char myfeof(FILE *f)
343 return(FALSE); 342 return(FALSE);
344} 343}
345 344
346static void cleanUpAndFail(int ec)
347{
348 int retVal;
349
350 if ((srcMode == SM_F2F) && (opMode != OM_TEST) && deleteOutputOnInterrupt) {
351 if (outputHandleJustInCase != NULL) {
352 fclose(outputHandleJustInCase);
353 }
354 retVal = remove(outName);
355 if (retVal != 0) {
356 error_msg("%s: WARNING: deletion of output file (apparently) failed.\n", applet_name);
357 }
358 }
359
360 exit(ec);
361}
362
363
364void BZ2_hbCreateDecodeTables(int *limit, int *base, int *perm, unsigned char *length, int minLen, int maxLen, int alphaSize ) 345void BZ2_hbCreateDecodeTables(int *limit, int *base, int *perm, unsigned char *length, int minLen, int maxLen, int alphaSize )
365{ 346{
366 int pp, i, j, vec; 347 int pp, i, j, vec;
@@ -1783,15 +1764,15 @@ errhandler_io:
1783 error_msg("\n%s: I/O or other error, bailing out. " 1764 error_msg("\n%s: I/O or other error, bailing out. "
1784 "Possible reason follows.\n", applet_name); 1765 "Possible reason follows.\n", applet_name);
1785 perror(applet_name); 1766 perror(applet_name);
1786 cleanUpAndFail(1); 1767 exit(1);
1787 case BZ_DATA_ERROR: 1768 case BZ_DATA_ERROR:
1788 error_msg("\n%s: Data integrity error when decompressing.\n", applet_name); 1769 error_msg("\n%s: Data integrity error when decompressing.\n", applet_name);
1789 cleanUpAndFail(2); 1770 exit(2);
1790 case BZ_UNEXPECTED_EOF: 1771 case BZ_UNEXPECTED_EOF:
1791 error_msg("\n%s: Compressed file ends unexpectedly;\n\t" 1772 error_msg("\n%s: Compressed file ends unexpectedly;\n\t"
1792 "perhaps it is corrupted? *Possible* reason follows.\n", applet_name); 1773 "perhaps it is corrupted? *Possible* reason follows.\n", applet_name);
1793 perror(applet_name); 1774 perror(applet_name);
1794 cleanUpAndFail(2); 1775 exit(2);
1795 case BZ_DATA_ERROR_MAGIC: 1776 case BZ_DATA_ERROR_MAGIC:
1796 if (zStream != stdin) { 1777 if (zStream != stdin) {
1797 fclose(zStream); 1778 fclose(zStream);