meta-openembedded/meta-multimedia/recipes-multimedia/dvb-apps/files/0001-dvbdate-Remove-Obsoleted-stime-API-calls.patch
Khem Raj 3dd74712ed dvb-apps: Use tarball for SRC_URI and fix build on musl
Convert to using tarball for SRC_URI, this is only recipe in
meta-openembedded needing mercurial fetcher

Fix the stime replacement patch to fix type errors on time_t

| dvbdate.c:313:12: error: incompatible pointer to integer conversion assigning to 'time_t' (aka 'long') from 'time_t **' (aka 'long **') [-Wint-conversion]
|         ts.tv_sec = &new_time;
|                   ^ ~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-08-28 23:57:15 -07:00

28 lines
763 B
Diff

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(-)
--- a/util/dvbdate/dvbdate.c
+++ b/util/dvbdate/dvbdate.c
@@ -309,7 +309,10 @@ int atsc_scan_date(time_t *rx_time, unsi
*/
int set_time(time_t * new_time)
{
- if (stime(new_time)) {
+ struct timespec s = {0};
+ s.tv_sec = *new_time;
+
+ if (clock_settime(CLOCK_REALTIME, &s)) {
perror("Unable to set time");
return -1;
}