blob: 8ff1e029b0b67a6455ce2b8a595c5c6c6621a924 [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001From d6817dbaf407f65dd4af12c51736153fae8b217f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 Dec 2019 08:36:11 -0800
4Subject: [PATCH] dvbdate: Remove Obsoleted stime API calls
5
6stime() has been deprecated in glibc 2.31+ its recommended to
7replaced with clock_settime()
8
Patrick Williams8e7b46e2023-05-01 14:19:06 -05009Upstream-Status: Pending
Brad Bishope42b3e32020-01-15 22:08:42 -050010Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 util/dvbdate/dvbdate.c | 5 ++++-
13 1 file changed, 4 insertions(+), 1 deletion(-)
14
Brad Bishope42b3e32020-01-15 22:08:42 -050015--- a/util/dvbdate/dvbdate.c
16+++ b/util/dvbdate/dvbdate.c
Patrick Williams92b42cb2022-09-03 06:53:57 -050017@@ -309,7 +309,10 @@ int atsc_scan_date(time_t *rx_time, unsi
Brad Bishope42b3e32020-01-15 22:08:42 -050018 */
19 int set_time(time_t * new_time)
20 {
21- if (stime(new_time)) {
Patrick Williams92b42cb2022-09-03 06:53:57 -050022+ struct timespec s = {0};
23+ s.tv_sec = *new_time;
24+
25+ if (clock_settime(CLOCK_REALTIME, &s)) {
Brad Bishope42b3e32020-01-15 22:08:42 -050026 perror("Unable to set time");
27 return -1;
28 }