Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."

Today's Topics:

   1. [PATCH] timeserver: Fix false error message (Justin Maggard)


----------------------------------------------------------------------

Date: Thu, 25 Mar 2021 12:32:51 -0700
From: Justin Maggard <[email protected]>
Subject: [PATCH] timeserver: Fix false error message
To: [email protected]
Cc: Justin Maggard <[email protected]>
Message-ID: <[email protected]>

The gettimeofday() function returns -1 on error, but ntp_callback() was
testing for 0 instead since 7af765d10 (clock: Add TimeSynced signal
emitted when the system time has been synced), resulting in "Failed to
get current time" error messages.
---
 src/timeserver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/timeserver.c b/src/timeserver.c
index a55f1f79..040a7aef 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -66,7 +66,7 @@ static void ntp_callback(bool success, void *user_data)
                return;
        }
 
-       if (!gettimeofday(&tv, NULL)) {
+       if (gettimeofday(&tv, NULL) < 0) {
                connman_warn("Failed to get current time");
        }
 
-- 
2.31.0

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]


------------------------------

End of connman Digest, Vol 65, Issue 6
**************************************

Reply via email to