[tracker-miners/wip/carlosg/coverity-fixes: 16/16] libtracker-miners-common: Check g_remove() return value
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/coverity-fixes: 16/16] libtracker-miners-common: Check g_remove() return value
- Date: Tue, 15 Sep 2020 14:30:41 +0000 (UTC)
commit de1ed09b293d40f57dfabf4b593bb35fb073bef2
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Sep 7 19:06:30 2020 +0200
libtracker-miners-common: Check g_remove() return value
Check for errors, but ignore ENOENT, since it's a likely path (we delete
error report files for successful extraction without checks). Spotted by
Coverity.
CID: #361432
src/libtracker-miners-common/tracker-error-report.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miners-common/tracker-error-report.c
b/src/libtracker-miners-common/tracker-error-report.c
index e9567ee50..f34915494 100644
--- a/src/libtracker-miners-common/tracker-error-report.c
+++ b/src/libtracker-miners-common/tracker-error-report.c
@@ -96,7 +96,12 @@ tracker_error_report_delete (GFile *file)
uri = g_file_get_uri (file);
report_path = get_report_file (uri);
- g_remove (report_path);
+ if (g_remove (report_path) < 0) {
+ if (errno != ENOENT) {
+ g_warning ("Error removing path '%s': %m",
+ report_path);
+ }
+ }
g_free (report_path);
g_free (uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]