[vlc-devel] [PATCH 1/1] If the target libc lacks strerror_l, fallback to strerror_r.

Sean McGovern gseanmcg at gmail.com
Sun Mar 13 20:37:38 CET 2016


On Mar 13, 2016 14:31, "Richard Diamond" <wichard at vitalitystudios.com>
wrote:
>
> ---
>  configure.ac      | 2 +-
>  src/posix/error.c | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index be65881..7a1e04b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -574,7 +574,7 @@ need_libc=false
>
>  dnl Check for usual libc functions
>  AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
> -AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r
isatty lstat memalign mkostemp mmap open_memstream openat pread
posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale
pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
> +AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r
isatty lstat memalign mkostemp mmap open_memstream openat pread
posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale
pthread_cond_timedwait_monotonic_np pthread_condattr_setclock strerror_l])
>  AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync
getdelim getpid lldiv nrand48 poll posix_memalign recvmsg rewind sendmsg
setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep
strtof strtok_r strtoll swab tdestroy timegm timespec_get strverscmp])
>  AC_REPLACE_FUNCS([gettimeofday])
>  AC_CHECK_FUNCS(fdatasync,,
> diff --git a/src/posix/error.c b/src/posix/error.c
> index db51004..9b996cd 100644
> --- a/src/posix/error.c
> +++ b/src/posix/error.c

Hi Richard,

This will leak at call sites, so unfortunately it is a no-go. I just use
strerror() in my Solaris builds as it is thread-safe on my platform.

-- Sean McG.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160313/b889905e/attachment.html>


More information about the vlc-devel mailing list