0006-fix-glibc-2.31.patch 629 B

1234567891011121314151617181920212223
  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. [Fabrice: fix for gcc >= 14]
  6. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  7. --- a/util/dvbdate/dvbdate.c
  8. +++ b/util/dvbdate/dvbdate.c
  9. @@ -309,7 +309,10 @@
  10. */
  11. int set_time(time_t * new_time)
  12. {
  13. - if (stime(new_time)) {
  14. + struct timespec s = {0};
  15. + s.tv_sec = *new_time;
  16. +
  17. + if (clock_settime(CLOCK_REALTIME, &s)) {
  18. perror("Unable to set time");
  19. return -1;
  20. }