You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
904 B
35 lines
904 B
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,14 @@
|
|
*/
|
|
int set_time(time_t * new_time)
|
|
{
|
|
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 31)
|
|
+ struct timespec s = {0};
|
|
+ s.tv_sec = new_time;
|
|
+
|
|
+ if (clock_settime(CLOCK_REALTIME, &s)) {
|
|
+#else
|
|
if (stime(new_time)) {
|
|
+#endif
|
|
perror("Unable to set time");
|
|
return -1;
|
|
}
|
|
--
|
|
2.24.1
|
|
|
|
|