xref: /OK3568_Linux_fs/buildroot/package/dvb-apps/0006-fix-glibc-2.31.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1dvbdate: fix compilation error with glibc 2.31
2
3as stime func doesn't exists anymore in newer versions of glibc >= 2.31 due
4to obseletion, a replacment with clock_settime is inorder to fix the issue.
5
6Signed-off-by: Dagg Stompler <daggs@gmx.com>
7
8--- a/util/dvbdate/dvbdate.c
9+++ b/util/dvbdate/dvbdate.c
10@@ -309,7 +309,10 @@
11  */
12 int set_time(time_t * new_time)
13 {
14-	if (stime(new_time)) {
15+	struct timespec s = {0};
16+	s.tv_sec = new_time;
17+
18+	if (clock_settime(CLOCK_REALTIME, &s)) {
19 		perror("Unable to set time");
20 		return -1;
21 	}
22