summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongha Hwang <mshrimp@sogang.ac.kr>2022-02-28 22:22:54 +0000
committerAlexander Schwinn <alexxcons@xfce.org>2022-02-28 22:22:54 +0000
commit90e30f2c6d881ad54251280775f00505f6960f2c (patch)
tree46c232febc92256996ae0aa9f1dea069e65e53d4
parenta7a172f376f695ae50d118a17ea6a63941b77d91 (diff)
downloadxfconf-90e30f2c6d881ad54251280775f00505f6960f2c.tar.gz
Replace GTimeVal with gint64 epoch time
-rw-r--r--tests/tests-common.h8
-rw-r--r--xfconf/xfconf-cache.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/tests-common.h b/tests/tests-common.h
index 28eb3d6..1e656d7 100644
--- a/tests/tests-common.h
+++ b/tests/tests-common.h
@@ -78,7 +78,7 @@ xfconf_tests_start(void)
{
GDBusConnection *conn;
GDBusMessage *msg, *ret;
- GTimeVal start, now;
+ gint64 start, now;
GError *error = NULL;
/* wait until xfconfd finishes starting */
@@ -93,14 +93,14 @@ xfconf_tests_start(void)
"/org/xfce/Xfconf",
"org.freedesktop.DBus.Peer",
"Ping");
- g_get_current_time(&start);
+ start = g_get_monotonic_time ();
while(!(ret = g_dbus_connection_send_message_with_reply_sync(conn,
msg,
G_DBUS_SEND_MESSAGE_FLAGS_NONE,
-1, NULL, NULL, NULL)))
{
- g_get_current_time(&now);
- if(now.tv_sec - start.tv_sec > WAIT_TIMEOUT) {
+ now = g_get_monotonic_time ();
+ if(now - start > WAIT_TIMEOUT * G_USEC_PER_SEC) {
g_critical("xfconfd failed to start after %d seconds", WAIT_TIMEOUT);
g_object_unref (msg);
xfconf_tests_end();
diff --git a/xfconf/xfconf-cache.c b/xfconf/xfconf-cache.c
index 1a0d536..74f8dd0 100644
--- a/xfconf/xfconf-cache.c
+++ b/xfconf/xfconf-cache.c
@@ -62,7 +62,7 @@
typedef struct
{
#if 0
- GTimeVal last_used;
+ gint64 last_used;
#endif
GValue *value;
} XfconfCacheItem;
@@ -77,7 +77,7 @@ xfconf_cache_item_new(const GValue *value,
item = g_slice_new0(XfconfCacheItem);
#if 0
- g_get_current_time(&item->last_used);
+ item->last_used = g_get_monotonic_time ();
#endif
if(G_LIKELY(steal)) {
@@ -106,7 +106,7 @@ xfconf_cache_item_update(XfconfCacheItem *item,
return FALSE;
#if 0
- g_get_current_time(&item->last_used);
+ item->last_used = g_get_monotonic_time ();
#endif
if(value) {