[FFmpeg-devel] [PATCH] adding _GNU_SOURCE for udp.c compilation

Michael Niedermayer michaelni
Mon Feb 11 03:30:55 CET 2008


On Sun, Feb 10, 2008 at 09:17:52PM -0500, Rich Felker wrote:
> On Sun, Feb 10, 2008 at 09:14:42PM -0500, Rich Felker wrote:
> > On Sun, Feb 10, 2008 at 07:20:31PM +0100, Nicolas George wrote:
> > > Hi.
> > > 
> > > Le duodi 22 pluvi?se, an CCXVI, Reimar D?ffinger a ?crit?:
> > > > Well in my header file (gentoo and debian) they are claimed to be part of
> > > > POSIX1.g, so they are not under a GNU ifdef.
> > > > Though I admit I could not find it in the POSIX specs I had lying
> > > > around.
> > > 
> > > Neither NI_MAXSERV nor NI_MAXHOST appear in the Single Unix Specification
> > > version 3, which is a superset of POSIX.
> > > 
> > > http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/resolv/netdb.h?annotate=1.47.2.1&cvsroot=glibc
> > > 
> > > shows that the check for _GNU_SOURCE has been added three weeks ago, with
> > > the log message "Cleanup namespace.".
> > > 
> > > getnameinfo seems to return EAI_OVERFLOW if the buffers are not big enough.
> > > EAI_OVERFLOW is standard, and described in the SUSv3 about netdb.h, but not
> > > referenced in the page about getnameinfo.
> > > 
> > > I fear that the only absolutely reliable way of doing this is to increase
> > > dynamically the buffer each time EAI_OVERFLOW is returned. Yet, using
> > > NI_MAX* when they are defined as the initial size for the buffer should be
> > > helpful nonetheless.
> > 
> > For the service number (port), sizeof(int)*3 is a perfectly acceptable
> > bound. This function does not even make use of the hbuf result so it
> > should be passing a null pointer for that rather than wasting
> > complexity and stack space.
> 
> And here is the patch.

ok and dont forget to add yourself to maintainers for udp :)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080211/83a4ee53/attachment.pgp>



More information about the ffmpeg-devel mailing list