summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/dvb-apps/files/0001-dvbdate-Remove-Obsoleted-stime-API-calls.patch
blob: 9035b56f4aea06fe941a5525389fa1b65479866d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From d6817dbaf407f65dd4af12c51736153fae8b217f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 21 Dec 2019 08:36:11 -0800
Subject: [PATCH] dvbdate: Remove Obsoleted stime API calls

stime() has been deprecated in glibc 2.31+ its recommended to
replaced with clock_settime()

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 util/dvbdate/dvbdate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/util/dvbdate/dvbdate.c b/util/dvbdate/dvbdate.c
index f0df437..492ed79 100644
--- a/util/dvbdate/dvbdate.c
+++ b/util/dvbdate/dvbdate.c
@@ -309,7 +309,10 @@ int atsc_scan_date(time_t *rx_time, unsigned int to)
  */
 int set_time(time_t * new_time)
 {
-	if (stime(new_time)) {
+	struct timespec ts;
+	ts.tv_sec = &new_time;
+	ts.tv_nsec = 0;
+	if (clock_settime(CLOCK_REALTIME, &ts)) {
 		perror("Unable to set time");
 		return -1;
 	}
-- 
2.24.1