glib: Use g_file_set_contents_full() throughout GLib and GIO

Where applicable. Where the current use of `g_file_set_contents()` seems
the most appropriate, leave that in place.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1302
This commit is contained in:
Philip Withnall
2020-05-27 18:00:48 +01:00
parent 24ed91ce33
commit 3b6460b94c
6 changed files with 25 additions and 11 deletions

View File

@@ -2211,7 +2211,9 @@ g_local_file_trash (GFile *file,
original_name_escaped, delete_time);
g_free (delete_time);
g_file_set_contents (infofile, data, -1, NULL);
g_file_set_contents_full (infofile, data, -1,
G_FILE_SET_CONTENTS_CONSISTENT | G_FILE_SET_CONTENTS_ONLY_EXISTING,
0600, NULL);
/* TODO: Maybe we should verify that you can delete the file from the trash
* before moving it? OTOH, that is hard, as it needs a recursive scan