1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-04 10:38:13 +00:00

#6006: Don't use newlocale/uselocale with uClibc below 0.9.34

Incomplete locale internals initialization in uClibc leads to crash upon
`newlocale` call.

See also: http://git.uclibc.org/uClibc/commit/?id=3902d0c472
This commit is contained in:
Mike Gelfand 2015-10-15 20:19:27 +00:00
parent c059eea6b4
commit 7d972ed5e6
3 changed files with 17 additions and 8 deletions

View file

@ -67,17 +67,10 @@
/* don't use pread/pwrite on old versions of uClibc because they're buggy.
* https://trac.transmissionbt.com/ticket/3826 */
#ifdef __UCLIBC__
#define TR_UCLIBC_CHECK_VERSION(major,minor,micro) \
(__UCLIBC_MAJOR__ > (major) || \
(__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ > (minor)) || \
(__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ == (minor) && \
__UCLIBC_SUBLEVEL__ >= (micro)))
#if !TR_UCLIBC_CHECK_VERSION (0,9,28)
#if defined (__UCLIBC__) && !TR_UCLIBC_CHECK_VERSION (0, 9, 28)
#undef HAVE_PREAD
#undef HAVE_PWRITE
#endif
#endif
#ifdef __APPLE__
#ifndef HAVE_PREAD

View file

@ -82,6 +82,16 @@ struct tr_error;
#define __has_extension __has_feature
#endif
#ifdef __UCLIBC__
#define TR_UCLIBC_CHECK_VERSION(major, minor, micro) \
(__UCLIBC_MAJOR__ > (major) || \
(__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ > (minor)) || \
(__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ == (minor) && \
__UCLIBC_SUBLEVEL__ >= (micro)))
#else
#define TR_UCLIBC_CHECK_VERSION(major, minor, micro) 0
#endif
/**
* @def TR_STATIC_ASSERT
* @brief This helper allows to perform static checks at compile time

View file

@ -43,6 +43,12 @@
#include "variant.h"
#include "variant-common.h"
/* don't use newlocale/uselocale on old versions of uClibc because they're buggy.
* https://trac.transmissionbt.com/ticket/6006 */
#if defined (__UCLIBC__) && !TR_UCLIBC_CHECK_VERSION (0, 9, 34)
#undef HAVE_USELOCALE
#endif
/**
***
**/