[tracker-miners/wip/carlosg/coverity-fixes: 22/28] libtracker-miners-common: Warn when failing to create folder




commit 3f958e492b2d84bd3bfa91ecb054fb3f8a5d940f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 24 12:11:43 2021 +0200

    libtracker-miners-common: Warn when failing to create folder
    
    Check the return value of g_mkdir_with_parents(), and warn on
    failures.
    
    CID: #365685

 src/libtracker-miners-common/tracker-error-report.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miners-common/tracker-error-report.c 
b/src/libtracker-miners-common/tracker-error-report.c
index 3cdd6f00f..8afc37917 100644
--- a/src/libtracker-miners-common/tracker-error-report.c
+++ b/src/libtracker-miners-common/tracker-error-report.c
@@ -38,7 +38,8 @@ tracker_error_report_init (GFile *cache_dir)
 
        report_file = g_file_get_child (cache_dir, "errors");
        report_dir = g_file_get_path (report_file);
-       g_mkdir_with_parents (report_dir, 0700);
+       if (g_mkdir_with_parents (report_dir, 0700) < 0)
+               g_warning ("Failed to create location for error reports: %m");
        g_object_unref (report_file);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]