diff options
author | Ondrej Holy <oholy@redhat.com> | 2019-09-16 17:05:58 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2019-09-20 11:53:57 +0000 |
commit | 82d5b6b821773c5ab17f37538dfd1834798d1922 (patch) | |
tree | fed32e9585ed80cc1e341b1cca14453d3c075b1b | |
parent | c48272e2d99af5840fd87541b199f469a3769ca0 (diff) | |
download | gvfs-82d5b6b821773c5ab17f37538dfd1834798d1922.tar.gz |
ftp: Remove usage of deprecated GTimeVal
GTimeVal is deprecated. Let's remove it in order to prevent the
deprecation warnings.
-rw-r--r-- | daemon/gvfsftpdircache.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/daemon/gvfsftpdircache.c b/daemon/gvfsftpdircache.c index 0412ed42..04927f05 100644 --- a/daemon/gvfsftpdircache.c +++ b/daemon/gvfsftpdircache.c @@ -612,7 +612,7 @@ g_vfs_ftp_dir_cache_funcs_process (GInputStream * stream, { struct list_result result = { 0, }; GFileType file_type = G_FILE_TYPE_UNKNOWN; - GTimeVal tv = { 0, 0 }; + time_t mtime; /* strip trailing \r - ParseFTPList only removes it if the line ends in \r\n, * but we stripped the \n already. @@ -717,16 +717,17 @@ g_vfs_ftp_dir_cache_funcs_process (GInputStream * stream, if (result.fe_time.tm_year >= 1900) result.fe_time.tm_year -= 1900; - tv.tv_sec = mktime (&result.fe_time); - if (tv.tv_sec != -1) + mtime = mktime (&result.fe_time); + if (mtime != -1) { - char *etag = g_strdup_printf ("%ld", tv.tv_sec); + char *etag = g_strdup_printf ("%ld", mtime); g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_ETAG_VALUE, etag); g_free (etag); - g_file_info_set_modification_time (info, &tv); + g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, mtime); + g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, 0); } g_vfs_ftp_dir_cache_entry_add (entry, file, info); |