X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=461f55b8ba6ffd519cf0e2ba760f3d018a25a6f8;hb=d0afef23e54f75a521eed8c7261a533776242cfc;hp=2e8c751638d492df165dc332f535dc6937adf8b0;hpb=8e007581c91a5193e6aec0f6f9aeb379a935c9d4;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 2e8c751..461f55b 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -58,6 +58,7 @@ struct mp { static void add_drives (struct drv *drv); static void prepare_drives (struct drv *drv); static void mount_mps (struct mp *mp); +static int launch (void); static void interactive (void); static void shell_script (void); static void script (int prompt); @@ -77,18 +78,6 @@ int remote_control = 0; int exit_on_error = 1; int command_num = 0; -int -launch (guestfs_h *_g) -{ - assert (_g == g); - - if (guestfs_is_config (g)) { - if (guestfs_launch (g) == -1) - return -1; - } - return 0; -} - static void __attribute__((noreturn)) usage (int status) { @@ -436,7 +425,7 @@ main (int argc, char *argv[]) * guest and mount them. */ if (next_prepared_drive > 1 || mps != NULL) { - if (launch (g) == -1) exit (EXIT_FAILURE); + if (launch () == -1) exit (EXIT_FAILURE); prepare_drives (drvs); mount_mps (mps); } @@ -554,6 +543,16 @@ prepare_drives (struct drv *drv) } } +static int +launch (void) +{ + if (guestfs_is_config (g)) { + if (guestfs_launch (g) == -1) + return -1; + } + return 0; +} + static void interactive (void) {