[gvfs/wip/oholy/gtimeval-gdatetime: 2/11] fuse: Remove usage of deprecated GTimeVal
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/oholy/gtimeval-gdatetime: 2/11] fuse: Remove usage of deprecated GTimeVal
- Date: Fri, 20 Sep 2019 11:42:03 +0000 (UTC)
commit b1ced5a79ce7f0e4fab74763761645176b1a3f85
Author: Ondrej Holy <oholy redhat com>
Date: Mon Sep 16 16:53:49 2019 +0200
fuse: Remove usage of deprecated GTimeVal
GTimeVal is deprecated. Let's remove it in order to prevent the
deprecation warnings.
client/gvfsfusedaemon.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 1ca6d121..00bd9129 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -536,11 +536,11 @@ file_info_get_attribute_as_int (GFileInfo *file_info, const gchar *attribute)
#endif
-static guint
+static guint64
file_info_get_attribute_as_uint (GFileInfo *file_info, const gchar *attribute)
{
GFileAttributeType attribute_type;
- guint uint_result;
+ guint64 uint_result;
attribute_type = g_file_info_get_attribute_type (file_info, attribute);
@@ -738,17 +738,14 @@ file_info_get_stat_mode (GFileInfo *file_info)
static void
set_attributes_from_info (GFileInfo *file_info, struct stat *sbuf)
{
- GTimeVal mod_time;
-
sbuf->st_mode = file_info_get_stat_mode (file_info);
sbuf->st_size = g_file_info_get_size (file_info);
sbuf->st_uid = daemon_uid;
sbuf->st_gid = daemon_gid;
- g_file_info_get_modification_time (file_info, &mod_time);
- sbuf->st_mtime = mod_time.tv_sec;
- sbuf->st_ctime = mod_time.tv_sec;
- sbuf->st_atime = mod_time.tv_sec;
+ sbuf->st_mtime = file_info_get_attribute_as_uint (file_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+ sbuf->st_ctime = sbuf->st_mtime;
+ sbuf->st_atime = sbuf->st_mtime;
if (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_TIME_CHANGED))
sbuf->st_ctime = file_info_get_attribute_as_uint (file_info, G_FILE_ATTRIBUTE_TIME_CHANGED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]