From: Richard W.M. Jones Date: Tue, 23 Aug 2011 15:41:07 +0000 (+0100) Subject: rescue: Ignore errno after guestfs_launch. X-Git-Tag: 1.12.5~22 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=732431bdf2ca71cd10909918165ad09931705570;p=libguestfs.git rescue: Ignore errno after guestfs_launch. errno is pretty much random on the error path back from guestfs_launch so there is nothing useful to be gained by checking it. We could do with a better way to detect if appliance launch failed. (cherry picked from commit 00fef9eed6a53e10a975814beef775483ff0b3dd) --- diff --git a/rescue/virt-rescue.c b/rescue/virt-rescue.c index dd033aa..7c8a57b 100644 --- a/rescue/virt-rescue.c +++ b/rescue/virt-rescue.c @@ -294,16 +294,6 @@ main (int argc, char *argv[]) /* 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 - * appliance exits unexpectedly. - */ - if (errno != ECHILD) { - fprintf (stderr, "%s: %s\n", program_name, guestfs_last_error (g)); - guestfs_close (g); - exit (EXIT_FAILURE); - } - guestfs_close (g); exit (EXIT_SUCCESS);