diff --git a/mozilla/profile/src/nsProfileAccess.cpp b/mozilla/profile/src/nsProfileAccess.cpp index 5d5a120dac1..ba9af5458c9 100644 --- a/mozilla/profile/src/nsProfileAccess.cpp +++ b/mozilla/profile/src/nsProfileAccess.cpp @@ -1744,17 +1744,7 @@ static struct sigaction SIGABRT_oldact; static struct sigaction SIGSEGV_oldact; static struct sigaction SIGTERM_oldact; -#ifdef HAVE_SIGINFO_T -// There is no standard type definition for the type of sa_sigaction. -extern "C" { -typedef void (*my_sigaction_t)(int, siginfo_t*, void*); -} - -void nsProfileLock::FatalSignalHandler(int signo, siginfo_t* info, - void* context) -#else void nsProfileLock::FatalSignalHandler(int signo) -#endif { // Remove any locks still held. RemovePidLockFiles(); @@ -1789,25 +1779,12 @@ void nsProfileLock::FatalSignalHandler(int signo) break; } - if (oldact) { -#ifdef HAVE_SIGINFO_T - if (oldact->sa_flags & SA_SIGINFO) { - if (oldact->sa_sigaction && - oldact->sa_sigaction != (my_sigaction_t) SIG_DFL && - oldact->sa_sigaction != (my_sigaction_t) SIG_IGN) - { - oldact->sa_sigaction(signo, info, context); - } - } else -#endif - { - if (oldact->sa_handler && - oldact->sa_handler != SIG_DFL && - oldact->sa_handler != SIG_IGN) - { - oldact->sa_handler(signo); - } - } + if (oldact && + oldact->sa_handler && + oldact->sa_handler != SIG_DFL && + oldact->sa_handler != SIG_IGN) + { + oldact->sa_handler(signo); } // Backstop exit call, just in case. @@ -2153,41 +2130,19 @@ nsresult nsProfileLock::Lock(nsILocalFile* aFile) // Don't arm a handler if the signal is being ignored, e.g., // because mozilla is run via nohup. struct sigaction act, oldact; -#ifdef HAVE_SIGINFO_T - act.sa_sigaction = FatalSignalHandler; - act.sa_flags = SA_SIGINFO; -#else act.sa_handler = FatalSignalHandler; act.sa_flags = 0; -#endif sigfillset(&act.sa_mask); -#ifdef HAVE_SIGINFO_T - #define CATCH_SIGNAL(signame) \ PR_BEGIN_MACRO \ if (sigaction(signame, NULL, &oldact) == 0 && \ - ((oldact.sa_flags & SA_SIGINFO) ? \ - (oldact.sa_sigaction != (my_sigaction_t) SIG_IGN) : \ - (oldact.sa_handler != SIG_IGN))) \ + oldact.sa_handler != SIG_IGN) \ { \ sigaction(signame, &act, &signame##_oldact); \ } \ PR_END_MACRO -#else - -#define CATCH_SIGNAL(signame) \ - PR_BEGIN_MACRO \ - if (sigaction(signame, NULL, &oldact) == 0 && \ - (oldact.sa_handler != SIG_IGN)) \ - { \ - sigaction(signame, &act, &signame##_oldact); \ - } \ - PR_END_MACRO - -#endif - CATCH_SIGNAL(SIGHUP); CATCH_SIGNAL(SIGINT); CATCH_SIGNAL(SIGQUIT); diff --git a/mozilla/profile/src/nsProfileAccess.h b/mozilla/profile/src/nsProfileAccess.h index 08489ef7801..d50123f8b16 100644 --- a/mozilla/profile/src/nsProfileAccess.h +++ b/mozilla/profile/src/nsProfileAccess.h @@ -33,10 +33,6 @@ #include #endif -#ifdef XP_UNIX -#include -#endif - class ProfileStruct { public: @@ -207,12 +203,7 @@ private: LHANDLE mLockFileHandle; #elif defined (XP_UNIX) static void RemovePidLockFiles(); -#ifdef HAVE_SIGINFO_T - static void FatalSignalHandler(int signo, siginfo_t* info, - void* context); -#else static void FatalSignalHandler(int signo); -#endif static PRCList mPidLockList; char* mPidLockFileName; int mLockFileDesc;