From 570c6374806d0f1ec59cf7a72543efe6b5b637be Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 15 Nov 2013 09:06:57 +0100 Subject: Fix/mute issues found by Coverity scan This makes the code free of Coverity scan issues. It is sometimes quite pedantic and expects/suggests some coding habits, thus certain changes may look weird, but for a good thing, I hope. The code is also tagged with Coverity scan suppressions, to keep the code as is and hide the warning too. Also note that Coverity treats g_return_if_fail(), g_assert() and similar macros as unreliable, and it's true these can be disabled during the compile time, thus it brings in other set of 'weird' changes. --- plugins/external-editor/external-editor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/external-editor') diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index 8f6e782919..97cb6abf5e 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -26,6 +26,8 @@ #include #endif +#include + #include #include #include @@ -374,7 +376,9 @@ external_editor_thread (gpointer user_data) g_idle_add ((GSourceFunc) update_composer_text, array); /* We no longer need that temporary file */ - g_remove (filename); + if (g_remove (filename) == -1) + g_warning ("%s: Failed to remove file '%s': %s", + G_STRFUNC, filename, g_strerror (errno)); g_free (filename); } } -- cgit v1.2.3