X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=rescue%2Fvirt-rescue.c;h=7c8a57b355e59b768c3249870ff911e6453880b6;hb=69abc787dddbf7855c2871f7f1432563a6af92a1;hp=8341e97545cd63b05940a1648de8f08dd4c52846;hpb=4155d20014b24b2203c4dd8b00e2e19450a7e3bb;p=libguestfs.git diff --git a/rescue/virt-rescue.c b/rescue/virt-rescue.c index 8341e97..7c8a57b 100644 --- a/rescue/virt-rescue.c +++ b/rescue/virt-rescue.c @@ -1,5 +1,5 @@ /* virt-rescue - * Copyright (C) 2010 Red Hat Inc. + * Copyright (C) 2010-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,13 +20,16 @@ #include #include +#include #include #include #include #include #include #include +#include +#include "ignore-value.h" #include "progname.h" #include "xvasprintf.h" @@ -95,6 +98,8 @@ main (int argc, char *argv[]) bindtextdomain (PACKAGE, LOCALEBASEDIR); textdomain (PACKAGE); + parse_config (); + enum { HELP_OPTION = CHAR_MAX + 1 }; static const char *options = "a:c:d:m:rvVx"; @@ -285,17 +290,9 @@ main (int argc, char *argv[]) * appliance. */ guestfs_set_error_handler (g, NULL, NULL); - 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); - } + /* We expect launch to fail, so ignore the return value. */ + ignore_value (guestfs_launch (g)); guestfs_close (g);