diff options
author | Ondrej Holy <oholy@redhat.com> | 2019-09-16 17:07:14 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2019-09-20 11:53:57 +0000 |
commit | 6cb822d46c32562dc9f7584c773f0108640f168f (patch) | |
tree | 7710edec87371934f2d582e775f176d2e9f3dc28 /metadata | |
parent | 643c8212aa106d46da1c231d8d1032390b0f39a1 (diff) | |
download | gvfs-6cb822d46c32562dc9f7584c773f0108640f168f.tar.gz |
metadata: Replace usage of deprecated GTimeVal by GDateTime
GTimeVal is deprecated. Let's replace it by GDateTime in order to
prevent the deprecation warnings.
Diffstat (limited to 'metadata')
-rw-r--r-- | metadata/metatree.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/metadata/metatree.c b/metadata/metatree.c index 0ba9dbab..0c11ddca 100644 --- a/metadata/metatree.c +++ b/metadata/metatree.c @@ -2397,11 +2397,11 @@ meta_tree_flush_locked (MetaTree *tree) /* It shouldn't happen. We failed to write out an updated tree * probably, therefore all the data are lost. Backup the file and * reload the tree to avoid further crashes. */ - GTimeVal tv; + GDateTime *dt; char *timestamp, *backup; - g_get_current_time (&tv); - timestamp = g_time_val_to_iso8601 (&tv); + dt = g_date_time_new_now_local (); + timestamp = g_date_time_format_iso8601 (dt); backup = g_strconcat (meta_tree_get_filename (tree), ".backup.", timestamp, NULL); g_rename (meta_tree_get_filename (tree), backup); @@ -2414,6 +2414,7 @@ meta_tree_flush_locked (MetaTree *tree) g_free (timestamp); g_free (backup); + g_date_time_unref (dt); res = meta_tree_refresh_locked (tree, TRUE); g_assert (res); |