Fix Chromium build with DPLOG_IF

Chromium has many build configurations. One important configuration
that’s not tested by its commit queue doesn’t use |condition| in
DLOG_IF(severity, condition) or any of the D*LOG_IF macros, resulting in
errors such as

…/handler/handler_main.cc:166:7: error: unused variable 'rv' [-Werror,-Wunused-variable]
  int rv = sigaction(sig, &sa, nullptr);
      ^

BUG=chromium:695314

Change-Id: I09a57379e8276b5ffa7f8f81706581a802d76809
Reviewed-on: https://chromium-review.googlesource.com/446559
Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
Mark Mentovai 2017-02-23 09:50:52 -05:00
parent 6da9708e7c
commit 4a2043ea65

View File

@ -165,6 +165,7 @@ void RestoreDefaultSignalHandler(int sig) {
sa.sa_handler = SIG_DFL;
int rv = sigaction(sig, &sa, nullptr);
DPLOG_IF(ERROR, rv != 0) << "sigaction " << sig;
ALLOW_UNUSED_LOCAL(rv);
}
void HandleCrashSignal(int sig, siginfo_t* siginfo, void* context) {
@ -240,6 +241,7 @@ void HandleCrashSignal(int sig, siginfo_t* siginfo, void* context) {
// initially triggered.
int rv = raise(sig);
DPLOG_IF(ERROR, rv != 0) << "raise";
ALLOW_UNUSED_LOCAL(rv);
}
}
@ -253,6 +255,7 @@ void HandleTerminateSignal(int sig, siginfo_t* siginfo, void* context) {
// because termination signals never originate in that way.
int rv = raise(sig);
DPLOG_IF(ERROR, rv != 0) << "raise";
ALLOW_UNUSED_LOCAL(rv);
}
void InstallCrashHandler() {