Change in osmo-sgsn[master]: Use osmo_clock_gettime from libosmocore

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
Fri Aug 17 14:10:14 UTC 2018


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

Change subject: Use osmo_clock_gettime from libosmocore
......................................................................

Use osmo_clock_gettime from libosmocore

Change-Id: Ic638849c6687c376c4c0c36cc286d499a073d6ca
---
M src/gprs/gb_proxy.c
M src/gprs/gb_proxy_vty.c
M src/gprs/gprs_llc_vty.c
M src/gprs/gprs_sgsn.c
M src/gprs/gtphub.c
M src/gprs/sgsn_cdr.c
6 files changed, 10 insertions(+), 10 deletions(-)

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



diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c
index dc3c810..f834ed3 100644
--- a/src/gprs/gb_proxy.c
+++ b/src/gprs/gb_proxy.c
@@ -591,7 +591,7 @@
 		return 0;
 
 
-	clock_gettime(CLOCK_MONOTONIC, &ts);
+	osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
 	now = ts.tv_sec;
 
 	gbprox_update_current_raid(parse_ctx.bssgp_raid_enc, peer,
@@ -707,7 +707,7 @@
 	if (!peer)
 		return;
 
-	clock_gettime(CLOCK_MONOTONIC, &ts);
+	osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
 	now = ts.tv_sec;
 
 	if (parse_ctx.g48_hdr) {
@@ -1432,7 +1432,7 @@
 		LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n");
 		return -1;
 	}
-	clock_gettime(CLOCK_REALTIME, &tp);
+	osmo_clock_gettime(CLOCK_REALTIME, &tp);
 
 	return 0;
 }
diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c
index d7d35fe..cd10abf 100644
--- a/src/gprs/gb_proxy_vty.c
+++ b/src/gprs/gb_proxy_vty.c
@@ -491,7 +491,7 @@
 	time_t now;
 	struct timespec ts = {0,};
 
-	clock_gettime(CLOCK_MONOTONIC, &ts);
+	osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
 	now = ts.tv_sec;
 
 	llist_for_each_entry(peer, &g_cfg->bts_peers, list) {
@@ -727,7 +727,7 @@
 
 	state = &peer->patch_state;
 
-	clock_gettime(CLOCK_MONOTONIC, &ts);
+	osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
 	now = ts.tv_sec;
 
 	if (match == MATCH_STALE) {
diff --git a/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c
index 1433efe..418be83 100644
--- a/src/gprs/gprs_llc_vty.c
+++ b/src/gprs/gprs_llc_vty.c
@@ -71,7 +71,7 @@
 {
 	unsigned int i;
 	struct timespec now_tp = {0};
-	clock_gettime(CLOCK_MONOTONIC, &now_tp);
+	osmo_clock_gettime(CLOCK_MONOTONIC, &now_tp);
 
 	vty_out(vty, "TLLI %08x (Old TLLI %08x) BVCI=%u NSEI=%u %s: "
 		"IOV-UI=0x%06x CKSN=%d Age=%d: State %s%s", llme->tlli,
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 9046157..d8bca85 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -936,7 +936,7 @@
 
 	int rc;
 
-	rc = clock_gettime(CLOCK_MONOTONIC, &now_tp);
+	rc = osmo_clock_gettime(CLOCK_MONOTONIC, &now_tp);
 	OSMO_ASSERT(rc >= 0);
 	now = now_tp.tv_sec;
 
diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c
index 4ee20cd..ca5857b 100644
--- a/src/gprs/gtphub.c
+++ b/src/gprs/gtphub.c
@@ -791,7 +791,7 @@
 time_t gtphub_now(void)
 {
 	struct timespec now_tp;
-	OSMO_ASSERT(clock_gettime(CLOCK_MONOTONIC, &now_tp) >= 0);
+	OSMO_ASSERT(osmo_clock_gettime(CLOCK_MONOTONIC, &now_tp) >= 0);
 	return now_tp.tv_sec;
 }
 
diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c
index 7380e74..93ed0af 100644
--- a/src/gprs/sgsn_cdr.c
+++ b/src/gprs/sgsn_cdr.c
@@ -177,7 +177,7 @@
 	if (pdp->ggsn)
 		inet_ntop(AF_INET, &pdp->ggsn->gsn->gsnc.s_addr, sgsn_addr, sizeof(sgsn_addr));
 
-	clock_gettime(CLOCK_MONOTONIC, &tp);
+	osmo_clock_gettime(CLOCK_MONOTONIC, &tp);
 	gettimeofday(&tv, NULL);
 
 	/* convert the timestamp to UTC */
@@ -267,7 +267,7 @@
 		cdr_log_mm(inst, "free", signal_data->mm);
 		break;
 	case S_SGSN_PDP_ACT:
-		clock_gettime(CLOCK_MONOTONIC, &signal_data->pdp->cdr_start);
+		osmo_clock_gettime(CLOCK_MONOTONIC, &signal_data->pdp->cdr_start);
 		signal_data->pdp->cdr_charging_id = signal_data->pdp->lib->cid;
 		cdr_log_pdp(inst, "pdp-act", signal_data->pdp);
 		osmo_timer_setup(&signal_data->pdp->cdr_timer, cdr_pdp_timeout,

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic638849c6687c376c4c0c36cc286d499a073d6ca
Gerrit-Change-Number: 10487
Gerrit-PatchSet: 3
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180817/fd7c85d6/attachment.htm>


More information about the gerrit-log mailing list