0005-Fix-musl-build.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 075472ec580e03cc89971f0c118cb363776a304d Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Tue, 16 May 2023 20:22:12 +0200
  4. Subject: [PATCH] Fix musl build
  5. malloc_trim is a GNU extension and therefore not present in non-glibc C
  6. libraries such as musl. Wrapping this in an ifdef fixes musl builds.
  7. Upstream: https://www.linuxtv.org/pipermail/vdr/2023-May/029742.html
  8. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  9. ---
  10. vdr.c | 2 ++
  11. 1 file changed, 2 insertions(+)
  12. diff --git a/vdr.c b/vdr.c
  13. index 0f426e61..bc4902de 100644
  14. --- a/vdr.c
  15. +++ b/vdr.c
  16. @@ -1588,12 +1588,14 @@ int main(int argc, char *argv[])
  17. cSchedules::Cleanup();
  18. // Plugins housekeeping:
  19. PluginManager.Housekeeping();
  20. +#if defined(__GLIBC__)
  21. // Memory cleanup:
  22. static time_t LastMemoryCleanup = 0;
  23. if ((Now - LastMemoryCleanup) > MEMCLEANUPDELTA) {
  24. malloc_trim(0);
  25. LastMemoryCleanup = Now;
  26. }
  27. +#endif
  28. }
  29. }
  30. --
  31. 2.39.2