After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786463 - gio-tool-save: Prevent overwriting error
gio-tool-save: Prevent overwriting error
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-08-18 11:30 UTC by Ondrej Holy
Modified: 2017-08-18 12:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio-tool-save: Prevent overwriting error (923 bytes, patch)
2017-08-18 11:30 UTC, Ondrej Holy
none Details | Review
gio-tool: Use print_file_error correctly (1.62 KB, patch)
2017-08-18 11:30 UTC, Ondrej Holy
none Details | Review
gio-tool-save: Prevent overwriting error (924 bytes, patch)
2017-08-18 12:42 UTC, Ondrej Holy
committed Details | Review
gio-tool: Use print_file_error correctly (1.55 KB, patch)
2017-08-18 12:44 UTC, Ondrej Holy
committed Details | Review

Description Ondrej Holy 2017-08-18 11:30:01 UTC
The following warning is shown, when both g_output_stream_write and
g_output_stream_close fail:
"GError set over the top of a previous GError or uninitialized memory."

Let's clear the error after use.
Comment 1 Ondrej Holy 2017-08-18 11:30:05 UTC
Created attachment 357886 [details] [review]
gio-tool-save: Prevent overwriting error
Comment 2 Ondrej Holy 2017-08-18 11:30:45 UTC
Created attachment 357887 [details] [review]
gio-tool: Use print_file_error correctly

Use print_file_error where an error relates to that file and vice versa.
Comment 3 Philip Withnall 2017-08-18 12:12:06 UTC
Review of attachment 357886 [details] [review]:

This is correct, modulo an indentation problem. Please push it to master once you’ve fixed that.

::: gio/gio-tool-save.c
@@ +111,3 @@
 		  save_res = FALSE;
                   print_error ("%s", error->message);
+                 g_clear_error (error);

Nitpick: Indentation problem.
Comment 4 Philip Withnall 2017-08-18 12:14:18 UTC
Review of attachment 357887 [details] [review]:

Looks good.
Comment 5 Ondrej Holy 2017-08-18 12:42:28 UTC
Created attachment 357892 [details] [review]
gio-tool-save: Prevent overwriting error

Fix indentation.
Comment 6 Ondrej Holy 2017-08-18 12:44:01 UTC
Created attachment 357894 [details] [review]
gio-tool: Use print_file_error correctly

Remove unrelated whitespace change.
Comment 7 Ondrej Holy 2017-08-18 12:47:28 UTC
Attachment 357892 [details] pushed as c7f2a7e - gio-tool-save: Prevent overwriting error
Attachment 357894 [details] pushed as 087525b - gio-tool: Use print_file_error correctly