File: glibc-stime.patch

package info (click to toggle)
linuxtv-dvb-apps 1.1.1%2Brev1500-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,980 kB
  • sloc: ansic: 49,043; makefile: 810; perl: 236; sh: 110; xml: 13
file content (16 lines) | stat: -rw-r--r-- 453 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
The obsolete stime function is no longer available to newly linked binaries
since glibc 2.31. Replace it by clock_settime.

--- a/util/dvbdate/dvbdate.c
+++ b/util/dvbdate/dvbdate.c
@@ -309,7 +309,9 @@ int atsc_scan_date(time_t *rx_time, unsi
  */
 int set_time(time_t * new_time)
 {
-	if (stime(new_time)) {
+	struct timespec ts = { .tv_sec = new_time };
+
+	if (clock_settime(CLOCK_REALTIME, &ts)) {
 		perror("Unable to set time");
 		return -1;
 	}