@@ -829,10 +829,9 @@ void mySignalCatcher ( IntNative n )
829
829
static
830
830
void mySIGSEGVorSIGBUScatcher ( IntNative n )
831
831
{
832
+ const char * msg ;
832
833
if (opMode == OM_Z )
833
- fprintf (
834
- stderr ,
835
- "\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n"
834
+ msg = ": Caught a SIGSEGV or SIGBUS whilst compressing.\n"
836
835
"\n"
837
836
" Possible causes are (most likely first):\n"
838
837
" (1) This computer has unreliable memory or cache hardware\n"
@@ -848,12 +847,9 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
848
847
" bug report should have. If the manual is available on your\n"
849
848
" system, please try and read it before mailing me. If you don't\n"
850
849
" have the manual or can't be bothered to read it, mail me anyway.\n"
851
- "\n" ,
852
- progName );
853
- else
854
- fprintf (
855
- stderr ,
856
- "\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
850
+ "\n" ;
851
+ else
852
+ msg = ": Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
857
853
"\n"
858
854
" Possible causes are (most likely first):\n"
859
855
" (1) The compressed data is corrupted, and bzip2's usual checks\n"
@@ -871,13 +867,25 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
871
867
" bug report should have. If the manual is available on your\n"
872
868
" system, please try and read it before mailing me. If you don't\n"
873
869
" have the manual or can't be bothered to read it, mail me anyway.\n"
874
- "\n" ,
875
- progName );
876
-
877
- showFileNames ();
878
- if (opMode == OM_Z )
879
- cleanUpAndFail ( 3 ); else
880
- { cadvise (); cleanUpAndFail ( 2 ); }
870
+ "\n" ;
871
+ write ( STDERR_FILENO , "\n" , 1 );
872
+ write ( STDERR_FILENO , progName , strlen ( progName ) );
873
+ write ( STDERR_FILENO , msg , strlen ( msg ) );
874
+
875
+ msg = "\tInput file = " ;
876
+ write ( STDERR_FILENO , msg , strlen (msg ) );
877
+ write ( STDERR_FILENO , inName , strlen (inName ) );
878
+ write ( STDERR_FILENO , "\n" , 1 );
879
+ msg = "\tOutput file = " ;
880
+ write ( STDERR_FILENO , msg , strlen (msg ) );
881
+ write ( STDERR_FILENO , outName , strlen (outName ) );
882
+ write ( STDERR_FILENO , "\n" , 1 );
883
+
884
+ /* Don't call cleanupAndFail. If we ended up here something went
885
+ terribly wrong. Trying to clean up might fail spectacularly. */
886
+
887
+ if (opMode == OM_Z ) setExit (3 ); else setExit (2 );
888
+ _exit (exitValue );
881
889
}
882
890
883
891
0 commit comments