Date: Tue, 26 Oct 2010 22:08:12 +0200 From: "Pawel Pekala" <c0rn@o2.pl> To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org> Subject: ports/151762: [maintainer] devel/upnp fix build for OSVERSION < 702000 Message-ID: <1288123692.32287@caprica.slowicza.org> Resent-Message-ID: <201010262010.o9QKAArW083270@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 151762 >Category: ports >Synopsis: [maintainer] devel/upnp fix build for OSVERSION < 702000 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue Oct 26 20:10:09 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Pawel Pekala >Release: FreeBSD 8.1-RELEASE i386 >Organization: >Environment: System: FreeBSD 8.1-RELEASE #2: Sat Aug 21 18:46:54 CEST 2010 corn@caprica.slowicza.org:/usr/obj/usr/src/sys/GENERIC >Description: - fix build for OSVERSION < 702000 >How-To-Repeat: >Fix: --- upnp-1.6.8_1,1.patch begins here --- diff -ruN --exclude=CVS /usr/ports/devel/upnp/Makefile /home/corn/devel/upnp/Makefile --- /usr/ports/devel/upnp/Makefile 2010-10-22 17:40:40.000000000 +0200 +++ /home/corn/devel/upnp/Makefile 2010-10-26 22:04:57.000000000 +0200 @@ -7,6 +7,7 @@ PORTNAME= upnp PORTVERSION= 1.6.8 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= devel MASTER_SITES= SF/p${PORTNAME}/p${PORTNAME}/libUPnP%20${PORTVERSION} @@ -38,4 +39,11 @@ ${REINPLACE_CMD} '/^pkgconfigexecdir/s|$$(libdir)|$$(prefix)/libdata|' \ ${WRKSRC}/Makefile.in -.include <bsd.port.mk> +.include <bsd.port.pre.mk> + +# strndup(3) was added in 7.2-RELEASE +.if ${OSVERSION} < 702000 +EXTRA_PATCHES+= ${FILESDIR}/extra-upnp-src-api-UpnpString.c +.endif + +.include <bsd.port.post.mk> diff -ruN --exclude=CVS /usr/ports/devel/upnp/files/extra-upnp-src-api-UpnpString.c /home/corn/devel/upnp/files/extra-upnp-src-api-UpnpString.c --- /usr/ports/devel/upnp/files/extra-upnp-src-api-UpnpString.c 1970-01-01 01:00:00.000000000 +0100 +++ /home/corn/devel/upnp/files/extra-upnp-src-api-UpnpString.c 2010-10-26 21:54:55.000000000 +0200 @@ -0,0 +1,14 @@ +--- upnp/src/api/UpnpString.c.orig 2010-10-26 21:46:15.000000000 +0200 ++++ upnp/src/api/UpnpString.c 2010-10-26 21:51:47.000000000 +0200 +@@ -165,8 +165,10 @@ + + int UpnpString_set_StringN(UpnpString *p, const char *s, size_t n) + { +- char *q = strndup(s, n); ++ char *q = malloc(n+1); + if (!q) goto error_handler1; ++ strncpy(q, s, n); ++ q[n-1] = '\0'; + free(((struct SUpnpString *)p)->m_string); + ((struct SUpnpString *)p)->m_length = strlen(q); + ((struct SUpnpString *)p)->m_string = q; --- upnp-1.6.8_1,1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1288123692.32287>