[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 03/12] build: silence coverity false positive



Similar in nature to commit fd21ecfd, which shut up valgrind.

sigaction is apparently a nasty interface for code analyzers.

* src/util/util.c (virExecWithHook): Initialize entire var, since
coverity gripes about the (unused and non-standard) sa_restorer.
---
 src/util/util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/util.c b/src/util/util.c
index e221abe..5672193 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -690,8 +690,8 @@ virExecWithHook(const char *const*argv,
          * so we need to temporarily block that again
          */
         struct sigaction waxon, waxoff;
+        memset(&waxoff, 0, sizeof(waxoff));
         waxoff.sa_handler = SIG_IGN;
-        waxoff.sa_flags = 0;
         sigemptyset(&waxoff.sa_mask);
         memset(&waxon, 0, sizeof(waxon));
         if (sigaction(SIGPIPE, &waxoff, &waxon) < 0) {
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]