]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
vdr: Fix build with GCC 11
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 18 May 2021 09:27:19 +0000 (09:27 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 5 Jul 2021 05:42:39 +0000 (07:42 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/vdr
src/patches/vdr-2.4-gcc-11.patch [new file with mode: 0644]

diff --git a/lfs/vdr b/lfs/vdr
index 9f36bdc8f2b977e3c4e65bb5bcfa286be9df56b1..a3eebfacd793eb3e658f0184b61ec6a49ab439e8 100644 (file)
--- a/lfs/vdr
+++ b/lfs/vdr
@@ -41,6 +41,8 @@ PAK_VER    = 12
 
 DEPS       = vdr_streamdev
 
+CXXFLAGS  += -std=c++11
+
 MAKE_OPTIONS = \
        PREFIX=/usr \
        BINDIR=/usr/bin \
@@ -99,6 +101,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
 
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/vdr-2.4-gcc-11.patch
+
        # Compile main package.
        cd $(DIR_APP) && make $(MAKE_OPTIONS) $(MAKETUNING) vdr include-dir
 
diff --git a/src/patches/vdr-2.4-gcc-11.patch b/src/patches/vdr-2.4-gcc-11.patch
new file mode 100644 (file)
index 0000000..1c56b5a
--- /dev/null
@@ -0,0 +1,24 @@
+From 46b480c798c2d5f4acb8874f25e5129f2cf7f224 Mon Sep 17 00:00:00 2001
+From: Klaus Schmidinger <vdr@tvdr.de>
+Date: Wed, 16 Sep 2020 13:30:59 +0200
+Subject: [PATCH] Fixed checking the return value of the Open() call in
+ cFileName::SetOffset()
+
+diff --git a/recording.c b/recording.c
+index 810ef80..1fc34cd 100644
+--- a/recording.c
++++ b/recording.c
+@@ -3025,8 +3025,8 @@ cUnbufferedFile *cFileName::SetOffset(int Number, off_t Offset)
+            }
+         // found a non existing file suffix
+         }
+-     if (Open() >= 0) {
+-        if (!record && Offset >= 0 && file && file->Seek(Offset, SEEK_SET) != Offset) {
++     if (Open()) {
++        if (!record && Offset >= 0 && file->Seek(Offset, SEEK_SET) != Offset) {
+            LOG_ERROR_STR(fileName);
+            return NULL;
+            }
+-- 
+2.26.2
+