summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-07-09 17:17:16 +0200
committerJohns <johns98@gmx.net>2012-07-09 17:17:16 +0200
commit15583a79c4e92c691c0a260b821a0f5702488526 (patch)
tree9b74b08d327ab8a3d3b4bdff8d8ca78a30160c85
parent2cdce610d656e33f3770ded5d1f6436ebe553fd6 (diff)
downloadvdr-plugin-softhddevice-15583a79c4e92c691c0a260b821a0f5702488526.tar.gz
vdr-plugin-softhddevice-15583a79c4e92c691c0a260b821a0f5702488526.tar.bz2
FreeBSD compatibility fix.
-rw-r--r--codec.c4
-rw-r--r--softhddev.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/codec.c b/codec.c
index 7dca837..369eb6f 100644
--- a/codec.c
+++ b/codec.c
@@ -39,7 +39,11 @@
#include <stdio.h>
#include <unistd.h>
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#else
#include <endian.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/softhddev.c b/softhddev.c
index 7860198..788049d 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -22,6 +22,9 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __FreeBSD__
+#include <signal.h>
+#endif
#include <fcntl.h>
#include <stdio.h>
@@ -2309,6 +2312,13 @@ int ProcessArgs(int argc, char *const argv[])
//
// Parse arguments.
//
+#ifdef __FreeBSD__
+ if (!strcmp(*argv, "softhddevice")) {
+ ++argv;
+ --argc;
+ }
+#endif
+
for (;;) {
switch (getopt(argc, argv, "-a:c:d:fg:p:sv:w:xD")) {
case 'a': // audio device for pcm
@@ -2396,7 +2406,11 @@ int ProcessArgs(int argc, char *const argv[])
#define XSERVER_MAX_ARGS 512 ///< how many arguments support
+#ifndef __FreeBSD__
static const char *X11Server = "/usr/bin/X"; ///< default x11 server
+#else
+static const char *X11Server = LOCALBASE "/bin/X"; ///< default x11 server
+#endif
static const char *X11ServerArguments; ///< default command arguments
static pid_t X11ServerPid; ///< x11 server pid
@@ -2442,7 +2456,12 @@ static void StartXServer(void)
if ((sval = X11ServerArguments)) {
char *s;
+#ifndef __FreeBSD__
s = buf = strdupa(sval);
+#else
+ s = buf = alloca(strlen(sval) + 1);
+ strcpy(buf, sval);
+#endif
while ((sval = strsep(&s, " \t"))) {
args[argn++] = sval;