mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-04 23:22:09 +01:00
gdump: Do not overwrite GError contents
In case of multiple IO failures we may try to use a GError multiple times, avoid so. See: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/411#note_1812951
This commit is contained in:
parent
d3d6fd6809
commit
b347a44e5e
11
gdump.c
11
gdump.c
@ -669,14 +669,11 @@ g_irepository_dump (const char *arg, GError **error)
|
||||
goutput_write (G_OUTPUT_STREAM (output), "</dump>\n");
|
||||
|
||||
{
|
||||
GError **ioerror;
|
||||
/* Avoid overwriting an earlier set error */
|
||||
if (caught_error)
|
||||
ioerror = NULL;
|
||||
else
|
||||
ioerror = error;
|
||||
caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL, ioerror);
|
||||
caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL, ioerror);
|
||||
caught_error |= !g_input_stream_close (G_INPUT_STREAM (in), NULL,
|
||||
caught_error ? NULL : error);
|
||||
caught_error |= !g_output_stream_close (G_OUTPUT_STREAM (output), NULL,
|
||||
caught_error ? NULL : error);
|
||||
}
|
||||
|
||||
g_object_unref (in);
|
||||
|
Loading…
x
Reference in New Issue
Block a user