From: Eric Blake Date: Thu, 2 Jun 2011 21:31:48 +0000 (-0600) Subject: build: silence coverity false positive X-Git-Tag: v0.9.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89e651fa762cba3df69af9adc7d9e0eff0eea47a;p=thirdparty%2Flibvirt.git build: silence coverity false positive Coverity complained that infd could be -1 at the point where it is passed to write, when in reality, this code can only be reached if infd is non-negative. * src/util/command.c (virCommandProcessIO): Help out coverity. --- diff --git a/src/util/command.c b/src/util/command.c index a2f7ff6223..b51bdcfd8c 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -961,6 +961,9 @@ virCommandProcessIO(virCommandPtr cmd) } else { int done; + /* Coverity 5.3.0 can't see that we only get here if + * infd is in the set because it was non-negative. */ + sa_assert(infd != -1); done = write(infd, cmd->inbuf + inoff, inlen - inoff); if (done < 0) {