X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=rescue%2Fvirt-rescue.c;h=7c8a57b355e59b768c3249870ff911e6453880b6;hb=fa44536b0ff12102c72ae0337e51d272f0fc2353;hp=f129b1c8e5e7d52ba217bb28d8b1cbb535a4f9ac;hpb=b8e1dee73a1deef1bfd5937e2abfbe9afef7b1ef;p=libguestfs.git diff --git a/rescue/virt-rescue.c b/rescue/virt-rescue.c index f129b1c..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" @@ -287,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);