aboutsummaryrefslogtreecommitdiffstats
path: root/net/minidlna
diff options
context:
space:
mode:
authorwg <wg@FreeBSD.org>2013-12-26 19:42:03 +0800
committerwg <wg@FreeBSD.org>2013-12-26 19:42:03 +0800
commitd9a24d9ffb50001c93d9a9f1debc869dc0b37686 (patch)
tree5435f7496e8735427951709573b5bf1173f965f4 /net/minidlna
parent13ca2390ad9e63253ee975ad4a076776284024fa (diff)
downloadfreebsd-ports-gnome-d9a24d9ffb50001c93d9a9f1debc869dc0b37686.tar.gz
freebsd-ports-gnome-d9a24d9ffb50001c93d9a9f1debc869dc0b37686.tar.zst
freebsd-ports-gnome-d9a24d9ffb50001c93d9a9f1debc869dc0b37686.zip
net/minidlna: fix for kqueue crashes on large media collections
- Fix for kqueue crashes on large media collections [1] - Make kqueue patch as an option so it can be disabled PR: ports/185155 [1] Submitted by: se
Diffstat (limited to 'net/minidlna')
-rw-r--r--net/minidlna/Makefile12
-rw-r--r--net/minidlna/files/extra-patch-kqueue (renamed from net/minidlna/files/patch-kqueue)21
2 files changed, 31 insertions, 2 deletions
diff --git a/net/minidlna/Makefile b/net/minidlna/Makefile
index fa8779c719c9..d23d0a1cb1df 100644
--- a/net/minidlna/Makefile
+++ b/net/minidlna/Makefile
@@ -3,7 +3,7 @@
PORTNAME= minidlna
PORTVERSION= 1.1.1
-PORTREVISION= 3
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= net multimedia www
MASTER_SITES= SF
@@ -37,11 +37,19 @@ SUB_LIST+= USER=${USERS}
USERS= dlna
GROUPS= dlna
-OPTIONS_DEFINE= NLS
+OPTIONS_DEFINE= KQUEUE NLS
+OPTIONS_DEFAULT=KQUEUE
OPTIONS_SUB= yes
+KQUEUE_DESC= Experimental patch for automatic rescan using kqueue(2)
NLS_USES= gettext
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MKQUEUE}
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-kqueue
+.endif
+
post-install:
${INSTALL_MAN} ${WRKSRC}/*.5 ${STAGEDIR}${MANPREFIX}/man/man5/
${INSTALL_MAN} ${WRKSRC}/*.8 ${STAGEDIR}${MANPREFIX}/man/man8/
diff --git a/net/minidlna/files/patch-kqueue b/net/minidlna/files/extra-patch-kqueue
index 7e5fdf8051cf..39a6d541467d 100644
--- a/net/minidlna/files/patch-kqueue
+++ b/net/minidlna/files/extra-patch-kqueue
@@ -750,6 +750,14 @@
else
--- ./minidlna.c.orig 2013-11-02 05:06:41.000000000 +0400
+++ ./minidlna.c 2013-11-13 17:25:27.000000000 +0400
+@@ -46,6 +46,7 @@
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
++#define FD_SETSIZE 8192
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
@@ -365,6 +365,7 @@
open_db(&db);
if (*scanner_pid == 0) /* child (scanner) process */
@@ -793,3 +801,16 @@
return (ret != SQLITE_OK);
}
+--- upnpevents.c~ 2013-11-02 02:06:41.000000000 +0100
++++ upnpevents.c 2013-12-24 12:22:41.533935174 +0100
+@@ -416,6 +416,10 @@
+ {
+ struct upnp_event_notify * obj;
+ for(obj = notifylist.lh_first; obj != NULL; obj = obj->entries.le_next) {
++ if (obj->s > FD_SETSIZE)
++ DPRINTF(E_FATAL, L_HTTP,
++ "upnpevents_selectfds: file descriptor %d too big for select, limit is %d\n",
++ obj->s, FD_SETSIZE);
+ DPRINTF(E_DEBUG, L_HTTP, "upnpevents_selectfds: %p %d %d\n",
+ obj, obj->state, obj->s);
+ if(obj->s >= 0) {