Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 1 | From d6817dbaf407f65dd4af12c51736153fae8b217f Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 21 Dec 2019 08:36:11 -0800 |
| 4 | Subject: [PATCH] dvbdate: Remove Obsoleted stime API calls |
| 5 | |
| 6 | stime() has been deprecated in glibc 2.31+ its recommended to |
| 7 | replaced with clock_settime() |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | util/dvbdate/dvbdate.c | 5 ++++- |
| 12 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 13 | |
| 14 | diff --git a/util/dvbdate/dvbdate.c b/util/dvbdate/dvbdate.c |
| 15 | index f0df437..492ed79 100644 |
| 16 | --- a/util/dvbdate/dvbdate.c |
| 17 | +++ b/util/dvbdate/dvbdate.c |
| 18 | @@ -309,7 +309,10 @@ int atsc_scan_date(time_t *rx_time, unsigned int to) |
| 19 | */ |
| 20 | int set_time(time_t * new_time) |
| 21 | { |
| 22 | - if (stime(new_time)) { |
| 23 | + struct timespec ts; |
| 24 | + ts.tv_sec = &new_time; |
| 25 | + ts.tv_nsec = 0; |
| 26 | + if (clock_settime(CLOCK_REALTIME, &ts)) { |
| 27 | perror("Unable to set time"); |
| 28 | return -1; |
| 29 | } |
| 30 | -- |
| 31 | 2.24.1 |
| 32 | |