]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
build: silence coverity false positive
authorEric Blake <eblake@redhat.com>
Thu, 2 Jun 2011 21:31:48 +0000 (15:31 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 3 Jun 2011 14:23:29 +0000 (08:23 -0600)
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.

src/util/command.c

index a2f7ff62233653fc3aa72fe425c6ed97e3ef8139..b51bdcfd8cba3cee54f3b240d982a850705a198a 100644 (file)
@@ -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) {