From 805cb234f3d9b3afc6c4bb7c82d9f7c64caeabce Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 21 Oct 2009 16:31:26 +0100 Subject: [PATCH] Set LC_ALL=C before running qemu. --- src/guestfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index e49f57a..a25e9e7 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -1195,6 +1195,8 @@ guestfs__launch (guestfs_h *g) setpgid (0, 0); #endif + setenv ("LC_ALL", "C", 1); + execv (g->qemu, g->cmdline); /* Run qemu. */ perror (g->qemu); _exit (1); @@ -1486,7 +1488,7 @@ test_qemu (guestfs_h *g) g->qemu_help = NULL; g->qemu_version = NULL; - snprintf (cmd, sizeof cmd, "'%s' -help", g->qemu); + snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -help", g->qemu); fp = popen (cmd, "r"); /* qemu -help should always work (qemu -version OTOH wasn't @@ -1508,7 +1510,7 @@ test_qemu (guestfs_h *g) if (pclose (fp) == -1) goto error; - snprintf (cmd, sizeof cmd, "'%s' -version 2>/dev/null", g->qemu); + snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -version 2>/dev/null", g->qemu); fp = popen (cmd, "r"); if (fp) { -- 1.8.3.1