From b0dbf44e7f93d08bd8b82d6fc7e3ca4edfea54b0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 28 Jun 2004 02:55:17 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3707 --- checkin_notes | 12 ++++++++++ zip/unzip/fileio.c | 21 ----------------- zip/unzip/unzip.c | 58 ---------------------------------------------- zip/zip/zip.c | 7 ------ zip/zip/zipcloak.c | 6 ----- zip/zip/zipnote.c | 4 ---- zip/zip/zipsplit.c | 4 ---- 7 files changed, 12 insertions(+), 100 deletions(-) diff --git a/checkin_notes b/checkin_notes index 451cc741a3..0ca777d540 100755 --- a/checkin_notes +++ b/checkin_notes @@ -14180,3 +14180,15 @@ David 27 June 2004 sched/ transitioner.C + +David 27 June 2004 + - changes (from Carl C.) to get rid of signal usage in zip/unzip code + + zip/unzip + fileio.c + unzip.c + zip/zip + zip.c + zipcloak.c + zipnote.c + zipsplit.c diff --git a/zip/unzip/fileio.c b/zip/unzip/fileio.c index 4c951acfe4..a31635a8d7 100644 --- a/zip/unzip/fileio.c +++ b/zip/unzip/fileio.c @@ -1573,30 +1573,9 @@ void handler(signal) /* upon interrupt, turn on echo and exit cleanly */ { GETGLOBALS(); -#if !(defined(SIGBUS) || defined(SIGSEGV)) /* add a newline if not at */ - (*G.message)((zvoid *)&G, slide, 0L, 0x41); /* start of line (to stderr; */ -#endif /* slide[] should be safe) */ echon(); -#ifdef SIGBUS - if (signal == SIGBUS) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "bus error")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGBUS */ - -#ifdef SIGSEGV - if (signal == SIGSEGV) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "segmentation violation")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGSEGV */ - /* probably ctrl-C */ DESTROYGLOBALS(); #if defined(AMIGA) && defined(__SASC) diff --git a/zip/unzip/unzip.c b/zip/unzip/unzip.c index 24e7c4e594..0b835afc78 100644 --- a/zip/unzip/unzip.c +++ b/zip/unzip/unzip.c @@ -650,16 +650,6 @@ int unzip(__G__ argc, argv) int i; #endif int retcode,error=FALSE; -#ifdef REENTRANT - savsigs_info *oldsighandlers = NULL; -# define SET_SIGHANDLER(sigtype, newsighandler) \ - if ((retcode = setsignalhandler(__G__ &oldsighandlers, (sigtype), \ - (newsighandler))) > PK_WARN) \ - goto cleanup_and_exit -#else -# define SET_SIGHANDLER(sigtype, newsighandler) \ - signal((sigtype), (newsighandler)) -#endif SETLOCALE(LC_CTYPE,""); @@ -700,19 +690,6 @@ int unzip(__G__ argc, argv) return jmperrcode; } -#ifdef SIGINT - SET_SIGHANDLER(SIGINT, handler); -#endif -#ifdef SIGTERM /* some systems really have no SIGTERM */ - SET_SIGHANDLER(SIGTERM, handler); -#endif -#ifdef SIGBUS - SET_SIGHANDLER(SIGBUS, handler); -#endif -#ifdef SIGSEGV - SET_SIGHANDLER(SIGSEGV, handler); -#endif - #if (defined(WIN32) && defined(__RSXNT__)) for (i = 0 ; i < argc; i++) { _ISO_INTERN(argv[i]); @@ -1028,41 +1005,6 @@ cleanup_and_exit: -#ifdef REENTRANT -/*******************************/ -/* Function setsignalhandler() */ -/*******************************/ - -static int setsignalhandler(__G__ p_savedhandler_chain, signal_type, - newhandler) - __GDEF - savsigs_info **p_savedhandler_chain; - int signal_type; - void (*newhandler)(int); -{ - savsigs_info *savsig; - - savsig = malloc(sizeof(savsigs_info)); - if (savsig == NULL) { - /* error message and break */ - Info(slide, 0x401, ((char *)slide, LoadFarString(CantSaveSigHandler))); - return PK_MEM; - } - savsig->sigtype = signal_type; - savsig->sighandler = signal(SIGINT, newhandler); - if (savsig->sighandler == SIG_ERR) { - free(savsig); - } else { - savsig->previous = *p_savedhandler_chain; - *p_savedhandler_chain = savsig; - } - return PK_OK; - -} /* end function setsignalhandler() */ - -#endif /* REENTRANT */ - - diff --git a/zip/zip/zip.c b/zip/zip/zip.c index c27d7ad42a..936276a0f1 100644 --- a/zip/zip/zip.c +++ b/zip/zip/zip.c @@ -42,7 +42,6 @@ # endif #endif -#include #define MAXCOM 256 /* Maximum one-line comment size */ @@ -1043,12 +1042,6 @@ int zip_main(int argc, char** argv) zipfile = tempzip = NULL; tempzf = NULL; d = 0; /* disallow adding to a zip file */ -#if (!defined(MACOS) && !defined(WINDLL)) - signal(SIGINT, handler); -#ifdef SIGTERM /* AMIGADOS and others have no SIGTERM */ - signal(SIGTERM, handler); -#endif -#endif /* !MACOS && !WINDLL */ k = 0; /* Next non-option argument type */ s = 0; /* set by -@ if -@ is early */ diff --git a/zip/zip/zipcloak.c b/zip/zip/zipcloak.c index 17f2081af8..e6b531088a 100644 --- a/zip/zip/zipcloak.c +++ b/zip/zip/zipcloak.c @@ -231,12 +231,6 @@ int main(argc, argv) /* Go through args */ zipfile = tempzip = NULL; tempzf = NULL; -#ifdef SIGINT - signal(SIGINT, handler); -#endif -#ifdef SIGTERM /* Some don't have SIGTERM */ - signal(SIGTERM, handler); -#endif temp_path = decrypt = 0; for (r = 1; r < argc; r++) { if (*argv[r] == '-') { diff --git a/zip/zip/zipnote.c b/zip/zip/zipnote.c index cd79844cdc..4d9caf8b0c 100644 --- a/zip/zip/zipnote.c +++ b/zip/zip/zipnote.c @@ -321,10 +321,6 @@ char **argv; /* command line tokens */ /* Go through args */ zipfile = tempzip = NULL; tempzf = NULL; - signal(SIGINT, handler); -#ifdef SIGTERM /* AMIGA has no SIGTERM */ - signal(SIGTERM, handler); -#endif k = w = 0; for (r = 1; r < argc; r++) if (*argv[r] == '-') { diff --git a/zip/zip/zipsplit.c b/zip/zip/zipsplit.c index 2937b76cc4..cf65e56bfb 100644 --- a/zip/zip/zipsplit.c +++ b/zip/zip/zipsplit.c @@ -459,10 +459,6 @@ char **argv; /* command line tokens */ init_upper(); /* build case map table */ /* Go through args */ - signal(SIGINT, handler); -#ifdef SIGTERM /* Amiga has no SIGTERM */ - signal(SIGTERM, handler); -#endif k = h = x = d = u = 0; c = DEFSIZ; for (r = 1; r < argc; r++)