[tracker/wip/carlosg/coverity-fixes: 5/16] libtracker-data: Check return value of g_unlink
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/coverity-fixes: 5/16] libtracker-data: Check return value of g_unlink
- Date: Sat, 23 Oct 2021 18:42:00 +0000 (UTC)
commit e44bae27a661943847cdd3d059b1d3e2c84daf08
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Oct 23 13:26:58 2021 +0200
libtracker-data: Check return value of g_unlink
Not being able to delete our own "in use" file is warning worthy.
CID: #1501146
src/libtracker-data/tracker-db-manager.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 63a7989b0..75472188b 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -763,7 +763,8 @@ tracker_db_manager_finalize (GObject *object)
if (db_manager->in_use_filename && !readonly) {
/* do not delete in-use file for read-only mode (direct access) */
- g_unlink (db_manager->in_use_filename);
+ if (g_unlink (db_manager->in_use_filename) < 0)
+ g_warning ("Could not delete '" IN_USE_FILENAME "': %m");
}
g_free (db_manager->in_use_filename);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]