From: Stephen Morris Date: Wed, 30 Jul 2014 17:01:32 +0000 (+0100) Subject: [3502] Explicitly ignore unwanted return value X-Git-Tag: trac3482_base~62^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83a514bfef12438e17550862b3825976e2e3a0a7;p=thirdparty%2Fkea.git [3502] Explicitly ignore unwanted return value A call to sigaction() is explicitly cast to void to indicate to static code checkers that the return value is being ignored. --- diff --git a/src/lib/util/signal_set.cc b/src/lib/util/signal_set.cc index b1308e1a1c..e39e1063aa 100644 --- a/src/lib/util/signal_set.cc +++ b/src/lib/util/signal_set.cc @@ -112,8 +112,12 @@ SignalSet::invokeOnReceiptHandler(int sig) { signal_processed = onreceipt_handler_(sig); } catch (const std::exception& ex) { // Restore the handler. We might fail to restore it, but we likely - // have bigger issues anyway. - sigaction(sig, &prev_sa, 0); + // have bigger issues anyway: for that reason, the return value is + // ignored. To avoid complaints from static code checkers that notice + // that the return values from other calls to sigaction() have been + // used, the call to sigaction is explicitly cast to void to indicate + // that the return value is intentionally being ignored. + static_cast(sigaction(sig, &prev_sa, 0)); isc_throw(SignalSetError, "onreceipt_handler failed for signal " << sig << ": " << ex.what()); }