Change in osmo-trx[master]: Timeval: Move to osmo_clock_gettime

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Dec 13 13:58:26 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12281 )

Change subject: Timeval: Move to osmo_clock_gettime
......................................................................

Timeval: Move to osmo_clock_gettime

Change-Id: I24da3e1136c5396062662be1d10b07b4d97cfc2e
---
M CommonLibs/Timeval.cpp
M CommonLibs/Timeval.h
2 files changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/CommonLibs/Timeval.cpp b/CommonLibs/Timeval.cpp
index 21072fc..fd1bcda 100644
--- a/CommonLibs/Timeval.cpp
+++ b/CommonLibs/Timeval.cpp
@@ -27,8 +27,17 @@
 
 #include "Timeval.h"
 
+extern "C" {
+#include <osmocom/core/timer.h>
+}
+
 using namespace std;
 
+void Timeval::now()
+{
+	osmo_clock_gettime(CLOCK_REALTIME, &mTimespec);
+}
+
 void Timeval::future(unsigned offset)
 {
 	now();
diff --git a/CommonLibs/Timeval.h b/CommonLibs/Timeval.h
index b780af1..7c6a6f6 100644
--- a/CommonLibs/Timeval.h
+++ b/CommonLibs/Timeval.h
@@ -47,7 +47,7 @@
 	public:
 
 	/** Set the value to current time. */
-	void now() { clock_gettime(CLOCK_REALTIME, &mTimespec); }
+	void now();
 
 	/** Set the value to gettimeofday plus an offset. */
 	void future(unsigned ms);

-- 
To view, visit https://gerrit.osmocom.org/12281
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I24da3e1136c5396062662be1d10b07b4d97cfc2e
Gerrit-Change-Number: 12281
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181213/46fbfff5/attachment.htm>


More information about the gerrit-log mailing list