summaryrefslogtreecommitdiffstats
path: root/src/launch.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-26 13:36:19 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-26 13:38:57 +0100
commit9e221e55b61e9f1cd0caf292ca609a4ca26f1d4d (patch)
tree8f8f333e0efe9e706d00e69ea76e68a4e944be20 /src/launch.c
parent11317b5d1243f3afc35f7abe8edc646f75813e36 (diff)
downloadlibguestfs-9e221e55b61e9f1cd0caf292ca609a4ca26f1d4d.tar.gz
libguestfs-9e221e55b61e9f1cd0caf292ca609a4ca26f1d4d.tar.xz
libguestfs-9e221e55b61e9f1cd0caf292ca609a4ca26f1d4d.zip
launch: Ensure errno from test_qemu_cmd is captured and printed.
Diffstat (limited to 'src/launch.c')
-rw-r--r--src/launch.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/launch.c b/src/launch.c
index 0317875e..86e1bc56 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -1385,8 +1385,8 @@ test_qemu (guestfs_h *g)
*/
if (test_qemu_cmd (g, cmd, &g->qemu_help) == -1) {
qemu_error:
- error (g, _("command failed: %s\n\nIf qemu is located on a non-standard path, try setting the LIBGUESTFS_QEMU\nenvironment variable. There may also be errors printed above."),
- cmd);
+ error (g, _("command failed: %s\nerrno: %s\n\nIf qemu is located on a non-standard path, try setting the LIBGUESTFS_QEMU\nenvironment variable. There may also be errors printed above."),
+ cmd, strerror (errno));
return -1;
}
@@ -1442,10 +1442,8 @@ read_all (guestfs_h *g, FILE *fp, char **ret)
*ret = safe_realloc (g, *ret, n + BUFSIZ);
p = &(*ret)[n];
r = fread (p, 1, BUFSIZ, fp);
- if (ferror (fp)) {
- perrorf (g, "read");
+ if (ferror (fp))
return -1;
- }
n += r;
goto again;
}