[MERGED] osmo-msc[master]: Fix value of stored SMS validity time.

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
Tue Jan 23 16:57:52 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: Fix value of stored SMS validity time.
......................................................................


Fix value of stored SMS validity time.

Quote the argument to sqlite's datetime(). Otherwise, the timestamp
stored in the database reads back as a negative value for some reason.

Before:

1032            validity_timestamp = dbi_result_get_datetime(result, "valid_until");
(gdb) p validity_timestamp
$2 = -1516814654

After:

1032            validity_timestamp = dbi_result_get_datetime(result, "valid_until");
(gdb) p validity_timestamp
$2 = 1516814654

Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a
---
M src/libmsc/db.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index 4bf9b1f..b48d137 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -711,7 +711,7 @@
 		 "user_data, text, "
 		 "dest_addr, dest_ton, dest_npi, "
 		 "src_addr, src_ton, src_npi) VALUES "
-		"(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), "
+		"(datetime('%lld', 'unixepoch'), datetime('%lld', 'unixepoch'), "
 		"%u, %u, %u, "
 		"%u, %u, %u, "
 		"%u, "

-- 
To view, visit https://gerrit.osmocom.org/5995
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a
Gerrit-PatchSet: 3
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte <keith at rhizomatica.org>



More information about the gerrit-log mailing list