Backing out patch for bug 171343. I need to do autoconf tests for siginfo_t and SA_SIGINFO, it seems.

This commit is contained in:
bryner%netscape.com 2002-10-08 05:51:24 +00:00
Родитель 24d3bea489
Коммит 00d8c265c4
2 изменённых файлов: 11 добавлений и 32 удалений

Просмотреть файл

@ -1625,11 +1625,7 @@ static struct sigaction SIGABRT_oldact;
static struct sigaction SIGSEGV_oldact;
static struct sigaction SIGTERM_oldact;
// There is no standard type definition for the type of sa_sigaction.
typedef void (*my_sigaction_t)(int, siginfo_t*, void*);
void nsProfileLock::FatalSignalHandler(int signo, siginfo_t* info,
void* context)
void nsProfileLock::FatalSignalHandler(int signo)
{
// Remove any locks still held.
RemovePidLockFiles();
@ -1664,22 +1660,12 @@ void nsProfileLock::FatalSignalHandler(int signo, siginfo_t* info,
break;
}
if (oldact) {
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 {
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.
@ -1943,16 +1929,14 @@ 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;
act.sa_sigaction = FatalSignalHandler;
act.sa_flags = SA_SIGINFO;
act.sa_handler = FatalSignalHandler;
act.sa_flags = 0;
sigfillset(&act.sa_mask);
#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); \
} \

Просмотреть файл

@ -33,10 +33,6 @@
#include <windows.h>
#endif
#ifdef XP_UNIX
#include <signal.h>
#endif
class ProfileStruct
{
public:
@ -202,8 +198,7 @@ private:
LHANDLE mLockFileHandle;
#elif defined (XP_UNIX)
static void RemovePidLockFiles();
static void FatalSignalHandler(int signo, siginfo_t* info,
void* context);
static void FatalSignalHandler(int signo);
static PRCList mPidLockList;
char* mPidLockFileName;
int mLockFileDesc;