[vlc-devel] commit: strerror(errno) is not thread-safe, use %m ( R??mi Denis-Courmont )

jpd at videolan.org jpd at videolan.org
Wed Oct 7 14:43:35 CEST 2009


On Wed, Oct 07, 2009 at 01:55:44PM +0200, Rafael Carre wrote:
> Anthony Loiseau <thannoy at actech-innovation.com> a ??crit :
> > Just a note (I have not tested anything).
> > - strerror() conforms to C89,C99 and POSIX
> sure, but it just is not thread safe so you shouldn't use it in VLC

AFAIK returning pointers to string constants is typically safe enough,
so strerror() should be fine except when returning a pointer to a static
buffer containing "unknown error NNN". Thus breaking only when the libc
and system calls are out of sync.

Not that I object to removing this mostly theoretical thread unsafe call.




More information about the vlc-devel mailing list