diff options
Diffstat (limited to 'net/udpcast/files')
-rw-r--r-- | net/udpcast/files/patch-libbb_udpcast.h | 13 | ||||
-rw-r--r-- | net/udpcast/files/patch-participants.h | 13 | ||||
-rw-r--r-- | net/udpcast/files/patch-rateGovernor.c | 28 | ||||
-rw-r--r-- | net/udpcast/files/patch-socklib.c | 58 | ||||
-rw-r--r-- | net/udpcast/files/patch-statistics.c | 11 | ||||
-rw-r--r-- | net/udpcast/files/patch-udpr-negotiate.c | 59 |
6 files changed, 96 insertions, 86 deletions
diff --git a/net/udpcast/files/patch-libbb_udpcast.h b/net/udpcast/files/patch-libbb_udpcast.h new file mode 100644 index 000000000000..1f2289b163ae --- /dev/null +++ b/net/udpcast/files/patch-libbb_udpcast.h @@ -0,0 +1,13 @@ +--- libbb_udpcast.h.orig 2009-02-10 10:07:40.000000000 +0100 ++++ libbb_udpcast.h 2009-02-10 10:06:51.000000000 +0100 +@@ -24,6 +24,10 @@ + #include <malloc.h> + #endif + ++#ifdef HAVE_STDLIB_H ++ #include <stdlib.h> ++#endif ++ + #define xmalloc malloc + + #endif /* BB_VER */ diff --git a/net/udpcast/files/patch-participants.h b/net/udpcast/files/patch-participants.h index f09b1aa4c62b..6e7ef8da3d7f 100644 --- a/net/udpcast/files/patch-participants.h +++ b/net/udpcast/files/patch-participants.h @@ -1,10 +1,13 @@ ---- participants.h.orig Tue Jul 20 13:49:28 2004 -+++ participants.h Tue Jul 20 13:49:40 2004 -@@ -3,6 +3,7 @@ +--- participants.h.orig 2005-12-22 23:59:18.000000000 +0100 ++++ participants.h 2009-02-05 12:18:19.000000000 +0100 +@@ -3,6 +3,10 @@ #define MAX_CLIENTS 1024 +#include <sys/types.h> - #include <sys/socket.h> - ++#include <sys/socket.h> ++ ++ typedef struct participantsDb *participantsDb_t; + + #define isParticipantValid udpc_isParticipantValid diff --git a/net/udpcast/files/patch-rateGovernor.c b/net/udpcast/files/patch-rateGovernor.c new file mode 100644 index 000000000000..14de493ebb02 --- /dev/null +++ b/net/udpcast/files/patch-rateGovernor.c @@ -0,0 +1,28 @@ +--- rateGovernor.c.orig 2008-09-20 09:07:29.000000000 +0200 ++++ rateGovernor.c 2009-02-09 08:20:17.000000000 +0100 +@@ -23,6 +23,25 @@ + #define DL_RATE_GOVERNOR + #endif + ++ ++#ifdef __FreeBSD__ ++char * ++strndup(const char *str, size_t n) ++{ ++ size_t len; ++ char *copy; ++ ++ for (len = 0; len < n && str[len]; len++) ++ continue; ++ ++ if ((copy = malloc(len + 1)) == NULL) ++ return (NULL); ++ memcpy(copy, str, len); ++ copy[len] = '\0'; ++ return (copy); ++} ++#endif ++ + void *rgInitGovernor(struct net_config *cfg, struct rateGovernor_t *gov) + { + if(cfg->nrGovernors == MAX_GOVERNORS) { diff --git a/net/udpcast/files/patch-socklib.c b/net/udpcast/files/patch-socklib.c index 03d62095cdad..974921257f31 100644 --- a/net/udpcast/files/patch-socklib.c +++ b/net/udpcast/files/patch-socklib.c @@ -1,38 +1,46 @@ ---- socklib.c.orig Sat Feb 21 13:58:37 2004 -+++ socklib.c Tue Jul 20 17:58:51 2004 -@@ -16,6 +16,8 @@ - #include "log.h" - #include "socklib.h" +--- socklib.c.orig 2008-09-18 22:43:15.000000000 +0200 ++++ socklib.c 2009-02-10 10:01:40.000000000 +0100 +@@ -18,6 +18,7 @@ + #endif + + #ifdef HAVE_NET_IF_H ++# include <sys/socket.h> + # include <net/if.h> + #endif + +@@ -66,6 +67,8 @@ + # define DEBUG 0 + #endif +#undef SIOCGIFINDEX + #ifdef LOSSTEST /** * Packet loss/swap testing... -@@ -289,7 +291,7 @@ +@@ -353,7 +356,7 @@ int setTtl(int sock, int ttl) { /* set the socket to broadcast */ -- return setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(int)); -+ return setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(int)); +- return setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(int)); ++ return setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(int)); } - #ifdef SIOCGIFINDEX -@@ -334,7 +336,7 @@ - int r; - - fillMreq(sock, ifname, addr, &mreq); -- r = setsockopt(sock, SOL_IP, code, &mreq, sizeof(mreq)); -+ r = setsockopt(sock, IPPROTO_IP, code, &mreq, sizeof(mreq)); - if(r < 0) { - perror(message); - exit(1); -@@ -366,7 +368,7 @@ - - - int setMcastDestination(int sock, char *ifname, struct sockaddr *addr) { --#ifdef __CYGWIN__ -+#if defined(__CYGWIN__) || defined(__FreeBSD__) + #ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX +@@ -422,7 +425,7 @@ + + + int setMcastDestination(int sock, net_if_t *net_if, struct sockaddr_in *addr) { +-#ifdef WINDOWS ++#if defined(WINDOWS) || defined(__FreeBSD__) int r; - struct sockaddr interface_addr; + struct sockaddr_in interface_addr; struct in_addr if_addr; +@@ -720,7 +723,7 @@ + + net_if->name = strdup(chosen->ifr_name); + +-#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX ++#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX__TODO + /* Index for multicast subscriptions */ + if(ioctl(s, SIOCGIFINDEX, chosen) < 0) + udpc_fatal(-1, "Error getting index for %s: %s", net_if->name, diff --git a/net/udpcast/files/patch-statistics.c b/net/udpcast/files/patch-statistics.c deleted file mode 100644 index 176e5136b246..000000000000 --- a/net/udpcast/files/patch-statistics.c +++ /dev/null @@ -1,11 +0,0 @@ ---- statistics.c.orig Tue Jul 20 10:46:11 2004 -+++ statistics.c Tue Jul 20 12:00:59 2004 -@@ -37,7 +37,7 @@ - static void printFilePosition(int fd) { - #ifndef __CYGWIN__ - if(fd != -1) { -- loff_t offset = lseek64(fd, 0, SEEK_CUR); -+ off_t offset = lseek(fd, 0, SEEK_CUR); - printLongNum(offset); - } - #endif diff --git a/net/udpcast/files/patch-udpr-negotiate.c b/net/udpcast/files/patch-udpr-negotiate.c index db9f50ba147d..c1a1fddbd386 100644 --- a/net/udpcast/files/patch-udpr-negotiate.c +++ b/net/udpcast/files/patch-udpr-negotiate.c @@ -1,8 +1,8 @@ ---- udpr-negotiate.c.orig Sat Feb 21 14:08:49 2004 -+++ udpr-negotiate.c Tue Jul 20 13:44:05 2004 -@@ -2,6 +2,10 @@ - #include <unistd.h> +--- udpr-negotiate.c.orig 2007-05-25 12:01:59.000000000 +0200 ++++ udpr-negotiate.c 2009-02-06 08:18:02.000000000 +0100 +@@ -3,6 +3,10 @@ #include <errno.h> + #include <sys/stat.h> +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include <sys/param.h> @@ -11,50 +11,19 @@ #include "log.h" #include "socklib.h" #include "udpcast.h" -@@ -16,6 +20,10 @@ - # define O_BINARY 0 - #endif - -+#ifdef __FreeBSD__ -+struct client_config client_config_on_exit_hack; -+#endif -+ - static int sendConnectReq(struct client_config *client_config, - struct net_config *net_config, - int haveServerAddress) { -@@ -48,6 +56,12 @@ - sendDisconnect(exitStatus, (struct client_config *) args); - } - -+#ifdef __FreeBSD__ -+static void sendDisconnectWrapper_on_exit_handler() { -+ sendDisconnectWrapper(0, &client_config_on_exit_hack); -+} -+#endif -+ - void sendDisconnect(int exitStatus, - struct client_config *client_config) { - int endianness = client_config->endianness; -@@ -144,7 +158,7 @@ +@@ -82,13 +86,13 @@ if(disk_config->fileName != NULL) { int oflags = O_CREAT | O_WRONLY; - if(!(disk_config->flags & FLAG_NOSYNC)) { + if((disk_config->flags & FLAG_SYNC)) { - oflags |= O_SYNC; + oflags |= O_FSYNC; + } else if( !(disk_config->flags & FLAG_NOSYNC)) { + struct stat buf; + if(stat(disk_config->fileName, &buf) == 0) { + /* If target is device, open it synchronously */ + if(S_ISCHR(buf.st_mode) || S_ISBLK(buf.st_mode)) +- oflags |= O_SYNC; ++ oflags |= O_FSYNC; + } } outFile = open(disk_config->fileName, oflags | O_BINARY, 0644); - if(outFile < 0) { -@@ -333,7 +347,13 @@ - pipedOutFile = openPipe(client_config.toServer, outFile, disk_config, - &pipePid); - #ifndef __CYGWIN__ -+# ifdef __FreeBSD__ -+ client_config_on_exit_hack = client_config; -+ -+ atexit(sendDisconnectWrapper_on_exit_handler); -+# else - on_exit(sendDisconnectWrapper, &client_config); -+# endif - #endif - { - struct fifo fifo; |