Fixed SOS plugin for core dumps.
{
*bytesRead = read;
}
- return error.Success() ? S_OK : E_FAIL;
+ return error.Success() || (read != 0) ? S_OK : E_FAIL;
}
HRESULT
{
*bytesWritten = written;
}
- return error.Success() ? S_OK : E_FAIL;
+ return error.Success() || (written != 0) ? S_OK : E_FAIL;
}
//----------------------------------------------------------------------------
#define PAL_INITIALIZE_DEBUGGER_EXCEPTIONS 0x10
#define PAL_INITIALIZE_ENSURE_STACK_SIZE 0x20
#define PAL_INITIALIZE_REGISTER_SIGNALS 0x40
-#define PAL_INITIALIZE_ENSURE_ALT_SIGNAL_STACK 0x80
// PAL_Initialize() flags
#define PAL_INITIALIZE (PAL_INITIALIZE_SYNC_THREAD | \
PAL_INITIALIZE_REGISTER_SIGTERM_HANDLER | \
PAL_INITIALIZE_DEBUGGER_EXCEPTIONS | \
PAL_INITIALIZE_ENSURE_STACK_SIZE | \
- PAL_INITIALIZE_REGISTER_SIGNALS | \
- PAL_INITIALIZE_ENSURE_ALT_SIGNAL_STACK)
+ PAL_INITIALIZE_REGISTER_SIGNALS)
typedef DWORD (PALAPI *PTHREAD_START_ROUTINE)(LPVOID lpThreadParameter);
typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
PALIMPORT
void
PALAPI
-PAL_SetInitializeFlags(
+PAL_InitializeWithFlags(
DWORD flags);
PALIMPORT
/* internal data declarations *********************************************/
-static bool ensure_alt_signal_stack = false;
-static bool registered_sigterm_handler = false;
#if !HAVE_MACH_EXCEPTIONS
static bool registered_signal_handlers = false;
#endif // !HAVE_MACH_EXCEPTIONS
+static bool registered_sigterm_handler = false;
struct sigaction g_previous_sigterm;
#if !HAVE_MACH_EXCEPTIONS
{
int st = 0;
- if (ensure_alt_signal_stack)
+ if (registered_signal_handlers)
{
stack_t oss;
--*/
void FreeSignalAlternateStack()
{
- if (ensure_alt_signal_stack)
+ if (registered_signal_handlers)
{
stack_t ss, oss;
// The man page for sigaltstack says that when the ss.ss_flags is set to SS_DISABLE,
if (flags & PAL_INITIALIZE_REGISTER_SIGNALS)
{
registered_signal_handlers = true;
+
/* we call handle_signal for every possible signal, even
if we don't provide a signal handler.
#ifdef INJECT_ACTIVATION_SIGNAL
handle_signal(INJECT_ACTIVATION_SIGNAL, inject_activation_handler, &g_previous_activation);
#endif
- }
-
- if (flags & PAL_INITIALIZE_ENSURE_ALT_SIGNAL_STACK)
- {
- ensure_alt_signal_stack = true;
if (!EnsureSignalAlternateStack())
{
return FALSE;
/*++
Function:
- PAL_InitializeFlags
+ PAL_InitializeWithFlags
Abstract:
This function is the first function of the PAL to be called.
--*/
int
PALAPI
-PAL_InitializeFlags(
+PAL_InitializeWithFlags(
int argc,
const char *const argv[],
DWORD flags)
extern "C"
int InitializeDllTest1()
{
- PAL_SetInitializeDLLFlags(PAL_INITIALIZE_DLL | PAL_INITIALIZE_REGISTER_SIGNALS | PAL_INITIALIZE_ENSURE_ALT_SIGNAL_STACK);
+ PAL_SetInitializeDLLFlags(PAL_INITIALIZE_DLL | PAL_INITIALIZE_REGISTER_SIGNALS);
return PAL_InitializeDLL();
}
extern "C"
int InitializeDllTest2()
{
- PAL_SetInitializeDLLFlags(PAL_INITIALIZE_DLL | PAL_INITIALIZE_REGISTER_SIGNALS | PAL_INITIALIZE_ENSURE_ALT_SIGNAL_STACK);
+ PAL_SetInitializeDLLFlags(PAL_INITIALIZE_DLL | PAL_INITIALIZE_REGISTER_SIGNALS);
return PAL_InitializeDLL();
}