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

Rémi Denis-Courmont remi at remlab.net
Mon Mar 14 03:47:48 CET 2016


Did you actually test this?!

-- 
Rémi Denis-Courmont
Sent from my NVIDIA Tegra-powered device

----- Reply message -----
De : "Richard Diamond" <wichard at vitalitystudios.com>
Pour : <vlc-devel at videolan.org>
Cc : "Richard Diamond" <wichard at vitalitystudios.com>
Objet : [vlc-devel] [PATCH 1/1] If the target libc lacks strerror_l, fallback to strerror_r.
Date : sam., mars 12, 2016 15:28

---
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
@@ -48,7 +48,11 @@ static const char *vlc_strerror_l(int errnum, const char *lname)
errno = saved_errno;
}

+#ifdef HAVE_STRERROR_L
const char *buf = strerror_l(errnum, loc);
+#else
+    const char *buf = strerror_r(errnum, NULL, 0);
+#endif

freelocale(loc);
return buf;
-- 
2.5.0

_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160313/6c687e7a/attachment.html>


More information about the vlc-devel mailing list