aports/testing/vdr/musl-compat.patch
2014-08-04 16:44:18 +02:00

183 lines
6.0 KiB
Diff

diff --git a/Makefile b/Makefile
index 0d3a8fc..43349ed 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses
CDEFINES = -D_GNU_SOURCE
CDEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-LIBS = -ljpeg -lpthread -ldl -lcap -lrt $(shell pkg-config --libs freetype2 fontconfig)
+LIBS = -ljpeg -lpthread -ldl -lcap -lrt -lintl $(shell pkg-config --libs freetype2 fontconfig)
INCLUDES ?= $(shell pkg-config --cflags freetype2 fontconfig)
# Directories:
diff --git a/PLUGINS/src/dvbsddevice/dvbsdffosd.c b/PLUGINS/src/dvbsddevice/dvbsdffosd.c
index 1a8caf8..b82cc52 100644
--- a/PLUGINS/src/dvbsddevice/dvbsdffosd.c
+++ b/PLUGINS/src/dvbsddevice/dvbsdffosd.c
@@ -10,7 +10,7 @@
#include <linux/dvb/osd.h>
#include <signal.h>
#include <sys/ioctl.h>
-#include <sys/unistd.h>
+#include <unistd.h>
#include <vdr/tools.h>
// --- cDvbSdFfOsd -----------------------------------------------------------
diff --git a/font.c b/font.c
index cd2c494..0c052a1 100644
--- a/font.c
+++ b/font.c
@@ -433,7 +433,7 @@ bool cFont::GetAvailableFontNames(cStringList *FontNames, bool Monospaced)
{
if (!FontNames->Size()) {
FcInit();
- FcObjectSet *os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
+ FcObjectSet *os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, (char *)NULL);
FcPattern *pat = FcPatternCreate();
FcPatternAddBool(pat, FC_SCALABLE, FcTrue);
if (Monospaced)
diff --git a/i18n.h b/i18n.h
index c3f1fc7..0ace2cd 100644
--- a/i18n.h
+++ b/i18n.h
@@ -17,6 +17,10 @@
#define I18N_MAX_LOCALE_LEN 16 // for buffers that hold en_US etc.
#define I18N_MAX_LANGUAGES 256 // for buffers that hold all available languages
+#ifndef __attribute_format_arg__
+#define __attribute_format_arg__(x)
+#endif
+
void I18nInitialize(const char *LocaleDir = NULL);
///< Detects all available locales and loads the language names and codes.
///< If LocaleDir is given, it must point to a static string that lives
diff --git a/osd.c b/osd.c
index 7e52782..c372245 100644
--- a/osd.c
+++ b/osd.c
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/unistd.h>
+#include <unistd.h>
#include "device.h"
#include "tools.h"
diff --git a/thread.c b/thread.c
index e5e19c9..fab13a2 100644
--- a/thread.c
+++ b/thread.c
@@ -143,7 +143,9 @@ cRwLock::cRwLock(bool PreferWriter)
{
pthread_rwlockattr_t attr;
pthread_rwlockattr_init(&attr);
+ #if defined(PTHREAD_RWLOCK_PREFER_WRITER_NP) && defined(PTHREAD_RWLOCK_PREFER_READER_NP)
pthread_rwlockattr_setkind_np(&attr, PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP);
+ #endif
pthread_rwlock_init(&rwlock, &attr);
}
@@ -179,7 +181,7 @@ cMutex::cMutex(void)
locked = 0;
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
pthread_mutex_init(&mutex, &attr);
}
@@ -507,7 +509,7 @@ bool cPipe::Open(const char *Command, const char *Mode)
int MaxPossibleFileDescriptors = getdtablesize();
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
close(i); //close all dup'ed filedescriptors
- if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) {
+ if (execl("/bin/sh", "sh", "-c", Command, (char *)NULL) == -1) {
LOG_ERROR_STR(Command);
close(fd[1 - iopipe]);
_exit(-1);
@@ -590,7 +592,7 @@ int SystemExec(const char *Command, bool Detached)
int MaxPossibleFileDescriptors = getdtablesize();
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
close(i); //close all dup'ed filedescriptors
- if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) {
+ if (execl("/bin/sh", "sh", "-c", Command, (char *)NULL) == -1) {
LOG_ERROR_STR(Command);
_exit(-1);
}
diff --git a/tools.c b/tools.c
index a2055ec..31fb245 100644
--- a/tools.c
+++ b/tools.c
@@ -32,6 +32,11 @@ int SysLogLevel = 3;
#define MAXSYSLOGBUF 256
+#ifndef ACCESSPERMS
+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
+
void syslog_with_tid(int priority, const char *format, ...)
{
va_list ap;
@@ -618,7 +623,7 @@ char *ReadLink(const char *FileName)
{
if (!FileName)
return NULL;
- char *TargetName = canonicalize_file_name(FileName);
+ char *TargetName = realpath(FileName, NULL);
if (!TargetName) {
if (errno == ENOENT) // file doesn't exist
TargetName = strdup(FileName);
diff --git a/tools.h b/tools.h
index 358f75e..2029e31 100644
--- a/tools.h
+++ b/tools.h
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
+#include <limits.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -31,6 +32,10 @@ typedef unsigned char uchar;
extern int SysLogLevel;
+#ifndef DEFFILEMODE
+#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */
+#endif
+
#define esyslog(a...) void( (SysLogLevel > 0) ? syslog_with_tid(LOG_ERR, a) : void() )
#define isyslog(a...) void( (SysLogLevel > 1) ? syslog_with_tid(LOG_INFO, a) : void() )
#define dsyslog(a...) void( (SysLogLevel > 2) ? syslog_with_tid(LOG_DEBUG, a) : void() )
@@ -567,7 +572,7 @@ public:
data[i] = T(0);
size = 0;
}
- void Sort(__compar_fn_t Compare)
+ void Sort(int (* Compare)(const void *, const void *))
{
qsort(data, size, sizeof(T), Compare);
}
diff --git a/vdr.c b/vdr.c
index 835d33d..977683d 100644
--- a/vdr.c
+++ b/vdr.c
@@ -610,9 +610,9 @@ int main(int argc, char *argv[])
}
else if (Terminal) {
// Claim new controlling terminal
- stdin = freopen(Terminal, "r", stdin);
- stdout = freopen(Terminal, "w", stdout);
- stderr = freopen(Terminal, "w", stderr);
+ freopen(Terminal, "r", stdin);
+ freopen(Terminal, "w", stdout);
+ freopen(Terminal, "w", stderr);
HasStdin = true;
tcgetattr(STDIN_FILENO, &savedTm);
}