X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=test-tool%2Ftest-tool.c;h=7b49dbecdc248588943e54cc84e3a2f2936ba9ab;hb=5a8c8b8bf6e846b8d2d7e710f814d24d9a0183c3;hp=39139e580923a1f7334a6fe9e45bdf5df3c06c5f;hpb=a6025c11d97ed5802b3729a93d224d2baa20ff12;p=libguestfs.git diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c index 39139e5..7b49dbe 100644 --- a/test-tool/test-tool.c +++ b/test-tool/test-tool.c @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include @@ -41,6 +43,13 @@ #define N_(str) str #endif +#if !ENABLE_NLS +#undef textdomain +#define textdomain(Domainname) /* empty */ +#undef bindtextdomain +#define bindtextdomain(Domainname, Dirname) /* empty */ +#endif + #define STREQ(a,b) (strcmp((a),(b)) == 0) #define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0) #define STRNEQ(a,b) (strcmp((a),(b)) != 0) @@ -51,12 +60,16 @@ #define STRCASENEQLEN(a,b,n) (strncasecmp((a),(b),(n)) != 0) #define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0) +#ifndef P_tmpdir +#define P_tmpdir "/tmp" +#endif + #define DEFAULT_TIMEOUT 120 static const char *helper = DEFAULT_HELPER; static int timeout = DEFAULT_TIMEOUT; -static char tmpf[] = "/tmp/libguestfs-test-tool-sda-XXXXXX"; -static char isof[] = "/tmp/libguestfs-test-tool-iso-XXXXXX"; +static char tmpf[] = P_tmpdir "/libguestfs-test-tool-sda-XXXXXX"; +static char isof[] = P_tmpdir "/libguestfs-test-tool-iso-XXXXXX"; static guestfs_h *g; static void preruncheck (void); @@ -229,7 +242,7 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } - if (guestfs_mount (g, "/dev/sda1", "/") == -1) { + if (guestfs_mount_options (g, "", "/dev/sda1", "/") == -1) { fprintf (stderr, _("libguestfs-test-tool: failed to mount /dev/sda1 on /\n")); exit (EXIT_FAILURE); @@ -260,7 +273,7 @@ main (int argc, char *argv[]) exit (EXIT_SUCCESS); } -static char qemuwrapper[] = "/tmp/libguestfs-test-tool-wrapper-XXXXXX"; +static char qemuwrapper[] = P_tmpdir "/libguestfs-test-tool-wrapper-XXXXXX"; static void cleanup_wrapper (void)