Coverity: Ignore return value from guestfs_launch in virt-rescue.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 23 Aug 2011 15:34:06 +0000 (16:34 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Sun, 28 Aug 2011 08:18:43 +0000 (09:18 +0100)
We expect guestfs_launch to fail in this program.
(cherry picked from commit 9bab154d48e367702b65852c3c822341b474ffd2)

rescue/virt-rescue.c

index 911b80a..dd033aa 100644 (file)
@@ -29,6 +29,7 @@
 #include <assert.h>
 #include <libintl.h>
 
+#include "ignore-value.h"
 #include "progname.h"
 #include "xvasprintf.h"
 
@@ -289,7 +290,9 @@ main (int argc, char *argv[])
    * appliance.
    */
   guestfs_set_error_handler (g, NULL, NULL);
-  guestfs_launch (g);
+
+  /* We expect launch to fail, so ignore the return value. */
+  ignore_value (guestfs_launch (g));
 
   /* launch() expects guestfsd to start. However, virt-rescue doesn't
    * run guestfsd, so this will always fail with ECHILD when the