[gvfs/wip/oholy/gtimeval-gdatetime: 7/10] ftp: Remove usage of deprecated GTimeVal
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/oholy/gtimeval-gdatetime: 7/10] ftp: Remove usage of deprecated GTimeVal
- Date: Wed, 18 Sep 2019 13:03:33 +0000 (UTC)
commit feac30f47701215e3cd6f0df22d7019702c23be9
Author: Ondrej Holy <oholy redhat com>
Date: Mon Sep 16 17:05:58 2019 +0200
ftp: Remove usage of deprecated GTimeVal
GTimeVal is deprecated. Let's remove it in order to prevent the
deprecation warnings.
daemon/gvfsftpdircache.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsftpdircache.c b/daemon/gvfsftpdircache.c
index 0412ed42..835cb3d8 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,16 @@ 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_vfs_ftp_dir_cache_entry_add (entry, file, info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]