vdr: fix build w/glibc-2.31

https://hydra.nixos.org/build/122891193
This commit is contained in:
Maximilian Bosch 2020-06-26 14:49:13 +02:00
parent 7193603c5f
commit 44fb6cc037
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
2 changed files with 21 additions and 1 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fontconfig, libjpeg, libcap, freetype, fribidi, pkgconfig
, gettext, systemd, perl, lib
, gettext, systemd, perl, lib, fetchpatch
, enableSystemd ? true
, enableBidi ? true
}: stdenv.mkDerivation rec {
@ -12,6 +12,11 @@
sha256 = "1p51b14aqzncx3xpfg0rjplc48pg7520035i5p6r5zzkqhszihr5";
};
patches = [
# Derived from http://git.tvdr.de/?p=vdr.git;a=commit;h=930c2cd2eb8947413e88404fa94c66e4e1db5ad6
./glibc2.31-compat.patch
];
enableParallelBuilding = true;
postPatch = "substituteInPlace Makefile --replace libsystemd-daemon libsystemd";

View file

@ -0,0 +1,15 @@
diff --git a/eit.c b/eit.c
index 50d8229..373dbca 100644
--- a/eit.c
+++ b/eit.c
@@ -391,7 +391,9 @@ cTDT::cTDT(const u_char *Data)
if (abs(diff) > MAX_TIME_DIFF) {
mutex.Lock();
if (abs(diff) > MAX_ADJ_DIFF) {
- if (stime(&dvbtim) == 0)
+ timespec ts = { 0 };
+ ts.tv_sec = dvbtim;
+ if (clock_settime(CLOCK_REALTIME, &ts) == 0)
isyslog("system time changed from %s (%ld) to %s (%ld)", *TimeToString(loctim), loctim, *TimeToString(dvbtim), dvbtim);
else
esyslog("ERROR while setting system time: %m");