[Xfce4-commits] [xfce/exo] 03/03: Fix GTimeVal deprecation

noreply at xfce.org noreply at xfce.org
Sat Apr 11 20:29:36 CEST 2020


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/exo.

commit 6b7798fa6a6bb531afadcc2ecef6763ad9504de6
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sat Apr 11 15:28:40 2020 -0300

    Fix GTimeVal deprecation
---
 exo-helper/exo-helper.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/exo-helper/exo-helper.c b/exo-helper/exo-helper.c
index de77b14..b5c1e5a 100644
--- a/exo-helper/exo-helper.c
+++ b/exo-helper/exo-helper.c
@@ -362,8 +362,8 @@ exo_helper_execute (ExoHelper   *helper,
                     const gchar *parameter,
                     GError     **error)
 {
-  GTimeVal      previous;
-  GTimeVal      current;
+  gint64        previous;
+  gint64        current;
   GdkDisplay   *display;
   gboolean      succeed = FALSE;
   GError       *err = NULL;
@@ -444,7 +444,7 @@ exo_helper_execute (ExoHelper   *helper,
       if (G_LIKELY (succeed))
         {
           /* determine the current time */
-          g_get_current_time (&previous);
+          previous = g_get_monotonic_time ();
 
           /* wait up to 5 seconds to see whether the command worked */
           for (;;)
@@ -473,10 +473,10 @@ exo_helper_execute (ExoHelper   *helper,
                 }
 
               /* determine the current time */
-              g_get_current_time (&current);
+              current = g_get_monotonic_time ();
 
               /* check if the command is still running after 5 seconds (which indicates that the command worked) */
-              if (((current.tv_sec - previous.tv_sec) * 1000ll + (current.tv_usec - previous.tv_usec) / 1000ll) > 5000ll)
+              if ((current - previous) / G_USEC_PER_SEC > 5)
                 break;
 
               /* wait some time */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list