mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 20:42:49 +00:00
Bug 372081 - "Toolkit profile Service should understand MOZ_PROFILELOCKING option" [p=romaxa@gmail.com (romaxa) r=bsmedberg a1.9=schrep]
This commit is contained in:
parent
2223458792
commit
b11fa9968b
@ -58,6 +58,7 @@
|
||||
#include "prnetdb.h"
|
||||
#include "prsystem.h"
|
||||
#include "prprf.h"
|
||||
#include "prenv.h"
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
@ -70,6 +71,8 @@
|
||||
// This code was moved from profile/src/nsProfileAccess.
|
||||
// **********************************************************************
|
||||
|
||||
static PRBool sDisableSignalHandling = PR_FALSE;
|
||||
|
||||
nsProfileLock::nsProfileLock() :
|
||||
mHaveLock(PR_FALSE)
|
||||
#if defined (XP_WIN)
|
||||
@ -84,6 +87,7 @@ nsProfileLock::nsProfileLock() :
|
||||
#if defined (XP_UNIX)
|
||||
next = prev = this;
|
||||
#endif
|
||||
sDisableSignalHandling = PR_GetEnv("MOZ_DISABLE_SIG_HANDLER") ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@ -379,10 +383,11 @@ nsresult nsProfileLock::LockWithSymlink(const nsACString& lockFilePath, PRBool a
|
||||
// Clean up on abnormal termination, using POSIX sigaction.
|
||||
// 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_handler = FatalSignalHandler;
|
||||
act.sa_flags = 0;
|
||||
sigfillset(&act.sa_mask);
|
||||
if (!sDisableSignalHandling) {
|
||||
struct sigaction act, oldact;
|
||||
act.sa_handler = FatalSignalHandler;
|
||||
act.sa_flags = 0;
|
||||
sigfillset(&act.sa_mask);
|
||||
|
||||
#define CATCH_SIGNAL(signame) \
|
||||
PR_BEGIN_MACRO \
|
||||
@ -393,15 +398,16 @@ PR_BEGIN_MACRO \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
CATCH_SIGNAL(SIGHUP);
|
||||
CATCH_SIGNAL(SIGINT);
|
||||
CATCH_SIGNAL(SIGQUIT);
|
||||
CATCH_SIGNAL(SIGILL);
|
||||
CATCH_SIGNAL(SIGABRT);
|
||||
CATCH_SIGNAL(SIGSEGV);
|
||||
CATCH_SIGNAL(SIGTERM);
|
||||
CATCH_SIGNAL(SIGHUP);
|
||||
CATCH_SIGNAL(SIGINT);
|
||||
CATCH_SIGNAL(SIGQUIT);
|
||||
CATCH_SIGNAL(SIGILL);
|
||||
CATCH_SIGNAL(SIGABRT);
|
||||
CATCH_SIGNAL(SIGSEGV);
|
||||
CATCH_SIGNAL(SIGTERM);
|
||||
|
||||
#undef CATCH_SIGNAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user