Mac OS X: setlocale function requires <locale.h> header file.
[libguestfs.git] / test-tool / test-tool.c
index f38490a..0f5ebfc 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
+#include <locale.h>
 
 #include <guestfs.h>
 
 #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)
@@ -85,6 +93,10 @@ usage (void)
 int
 main (int argc, char *argv[])
 {
+  setlocale (LC_ALL, "");
+  bindtextdomain (PACKAGE, LOCALEBASEDIR);
+  textdomain (PACKAGE);
+
   static const char *options = "t:?";
   static const struct option long_options[] = {
     { "help", 0, 0, '?' },
@@ -225,7 +237,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);