]> Git Repo - qemu.git/commitdiff
fw_cfg: Improve error message when can't load splash file
authorLi Qiang <[email protected]>
Thu, 1 Nov 2018 06:02:28 +0000 (23:02 -0700)
committerPhilippe Mathieu-Daudé <[email protected]>
Fri, 4 Jan 2019 14:30:52 +0000 (15:30 +0100)
read_splashfile() reports "failed to read splash file" without
further details. Get the details from g_file_get_contents(), and
include them in the error message. Also remove unnecessary 'res'
variable.

Signed-off-by: Li Qiang <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <1541052148[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
hw/nvram/fw_cfg.c

index 3cb726ff68f67274567f3c1e58e70c3e8f42ed67..9c4409be5e56407862a128455b187cd3964c98c6 100644 (file)
@@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
                              int *file_typep)
 {
     GError *err = NULL;
-    gboolean res;
     gchar *content;
     int file_type;
     unsigned int filehead;
     int bmp_bpp;
 
-    res = g_file_get_contents(filename, &content, file_sizep, &err);
-    if (res == FALSE) {
-        error_report("failed to read splash file '%s'", filename);
+    if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
+        error_report("failed to read splash file '%s': %s",
+                     filename, err->message);
         g_error_free(err);
         return NULL;
     }
This page took 0.027446 seconds and 4 git commands to generate.