blob: 9035b56f4aea06fe941a5525389fa1b65479866d [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
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 util/dvbdate/dvbdate.c | 5 ++++-
12 1 file changed, 4 insertions(+), 1 deletion(-)
13
14diff --git a/util/dvbdate/dvbdate.c b/util/dvbdate/dvbdate.c
15index f0df437..492ed79 100644
16--- a/util/dvbdate/dvbdate.c
17+++ b/util/dvbdate/dvbdate.c
18@@ -309,7 +309,10 @@ int atsc_scan_date(time_t *rx_time, unsigned int to)
19 */
20 int set_time(time_t * new_time)
21 {
22- if (stime(new_time)) {
23+ struct timespec ts;
24+ ts.tv_sec = &new_time;
25+ ts.tv_nsec = 0;
26+ if (clock_settime(CLOCK_REALTIME, &ts)) {
27 perror("Unable to set time");
28 return -1;
29 }
30--
312.24.1
32