0006-fix-glibc-2.31.patch 538 B

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