fish: remote: Make sure global cleanups are called for guestfish --listen.

Return to the main program ('fish.c') and perform global cleanups when
the guestfish remote server exits.
This commit is contained in:
Richard W.M. Jones
2012-03-12 15:13:29 +00:00
parent b3a9e81868
commit f7c744bbf8
3 changed files with 5 additions and 2 deletions

View File

@@ -495,6 +495,7 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
rc_listen ();
goto out;
}
/* -f (file) parameter? */
@@ -545,6 +546,7 @@ main (int argc, char *argv[])
else
cmdline (argv, optind, argc);
out:
cleanup_readline ();
if (progress_bars)

View File

@@ -130,7 +130,7 @@ extern void free_prep_data (void *data);
extern int vg_lv_parse (const char *device, char **vg, char **lv);
/* in rc.c (remote control) */
extern void rc_listen (void) __attribute__((noreturn));
extern void rc_listen (void);
extern int rc_remote (int pid, const char *cmd, size_t argc, char *argv[],
int exit_on_error);

View File

@@ -310,7 +310,8 @@ rc_listen (void)
}
unlink (sockpath);
exit (EXIT_SUCCESS);
/* This returns to 'fish.c', where it jumps to global cleanups and exits. */
}
/* Remote control client. */