test-tool: Parse the environment separately.

This lets us report bugs when parsing the environment.
This commit is contained in:
Richard W.M. Jones
2012-12-01 11:45:55 +00:00
parent e8d6d6f737
commit 921b716b0b

View File

@@ -174,12 +174,18 @@ main (int argc, char *argv[])
sleep (3);
/* Create the handle. */
g = guestfs_create ();
g = guestfs_create_flags (GUESTFS_CREATE_NO_ENVIRONMENT);
if (g == NULL) {
fprintf (stderr,
_("libguestfs-test-tool: failed to create libguestfs handle\n"));
exit (EXIT_FAILURE);
}
if (guestfs_parse_environment (g) == -1) {
fprintf (stderr,
_("libguestfs-test-tool: failed parsing environment variables.\n"
"Check earlier messages, and the output of the 'printenv' command.\n"));
exit (EXIT_FAILURE);
}
guestfs_set_verbose (g, 1);
make_files ();