Bug 1416199 - Don't try to set signal handlers in Windows coverage build. r=froydnj

--HG--
extra : rebase_source : f74f90bf0e146d674044eeef2c2e9b546335a564
This commit is contained in:
Marco Castelluccio 2017-11-10 12:50:14 +01:00
parent 25bb65f902
commit 0590afed91
2 changed files with 7 additions and 1 deletions

View File

@ -181,6 +181,7 @@ void counters_reset(int) {
static void
InstallCoverageSignalHandlers()
{
#ifndef XP_WIN
fprintf(stderr, "[CodeCoverage] Setting handlers for process %d.\n", getpid());
struct sigaction dump_sa;
@ -196,6 +197,7 @@ InstallCoverageSignalHandlers()
sigemptyset(&reset_sa.sa_mask);
mozilla::DebugOnly<int> r2 = sigaction(SIGUSR2, &reset_sa, nullptr);
MOZ_ASSERT(r2 == 0, "Failed to install GCOV SIGUSR2 handler");
#endif
}
#endif

View File

@ -3,9 +3,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <signal.h>
#include <stdio.h>
#ifndef XP_WIN
#include <signal.h>
#include <unistd.h>
#endif
#include "mozilla/CodeCoverageHandler.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/DebugOnly.h"
@ -62,6 +64,7 @@ void CodeCoverageHandler::ResetCounters(int)
void CodeCoverageHandler::SetSignalHandlers()
{
#ifndef XP_WIN
printf_stderr("[CodeCoverage] Setting handlers for process %d.\n", getpid());
struct sigaction dump_sa;
@ -77,6 +80,7 @@ void CodeCoverageHandler::SetSignalHandlers()
sigemptyset(&reset_sa.sa_mask);
DebugOnly<int> r2 = sigaction(SIGUSR2, &reset_sa, nullptr);
MOZ_ASSERT(r2 == 0, "Failed to install GCOV SIGUSR2 handler");
#endif
}
CodeCoverageHandler::CodeCoverageHandler()