mirror of https://github.com/xemu-project/xemu.git
fw_cfg: Improve error message when can't load splash file
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 <liq3ea@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1541052148-28752-1-git-send-email-liq3ea@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
6395fe0c2c
commit
bed6633677
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue