]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3502] Explicitly ignore unwanted return value
authorStephen Morris <stephen@isc.org>
Wed, 30 Jul 2014 17:01:32 +0000 (18:01 +0100)
committerStephen Morris <stephen@isc.org>
Wed, 30 Jul 2014 17:01:32 +0000 (18:01 +0100)
A call to sigaction() is explicitly cast to void to indicate to
static code checkers that the return value is being ignored.

src/lib/util/signal_set.cc

index b1308e1a1ce25f7eaebd6a4bfaeee826ded2ab67..e39e1063aaba7f75904eab964866e9863aa460a4 100644 (file)
@@ -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<void>(sigaction(sig, &prev_sa, 0));
         isc_throw(SignalSetError, "onreceipt_handler failed for signal "
                   << sig << ": " << ex.what());
     }