From f63009ad118b6564b68ab47ba42e47d020d63845 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Sat, 3 Aug 1996 15:20:28 +0200
Subject: [PATCH] bugfix for unsigned tv_sec

Rev: src/backend.c:1.7
---
 src/backend.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/backend.c b/src/backend.c
index 0dd97402ca..88cd20126c 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -191,11 +191,7 @@ void backend()
   while(first_object)
   {
     next_timeout.tv_usec = 0;
-#if 0
     next_timeout.tv_sec = 7 * 24 * 60 * 60;  /* See you in a week */
-#else
-    next_timeout.tv_sec = 15; /* See you in a week */
-#endif
     my_add_timeval(&next_timeout, &current_time);
 
     call_callback(& backend_callbacks, (void *)0);
@@ -207,10 +203,11 @@ void backend()
 #endif
 
     GETTIMEOFDAY(&current_time);
-    my_subtract_timeval(&next_timeout, &current_time);
 
-    if(next_timeout.tv_sec < 0)
+    if(my_timercmp(&next_timeout, > , &current_time))
     {
+      my_subtract_timeval(&next_timeout, &current_time);
+    }else{
       next_timeout.tv_usec = 0;
       next_timeout.tv_sec = 0;
     }
-- 
GitLab