[tracker] libtracker-data: Check g_mkdir return value
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Check g_mkdir return value
- Date: Wed, 14 Dec 2016 19:44:02 +0000 (UTC)
commit 5e075b248efe214d656759f822639cb517f03e61
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 14 19:51:52 2016 +0100
libtracker-data: Check g_mkdir return value
And error out if it failed.
src/libtracker-data/tracker-data-backup.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index 691b7b6..3947dde 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -312,7 +312,12 @@ dir_move_to_temp (const gchar *path)
gchar *temp_dir;
temp_dir = g_build_filename (path, "tmp", NULL);
- g_mkdir (temp_dir, 0777);
+ if (g_mkdir (temp_dir, 0777) < 0) {
+ g_critical ("Could not move %s to temp directory: %m",
+ path);
+ g_free (temp_dir);
+ return;
+ }
/* ensure that no obsolete temporary files are around */
dir_remove_files (temp_dir);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]