Changeset 14577


Ignore:
Timestamp:
Oct 15, 2015, 8:19:27 PM (6 years ago)
Author:
mikedld
Message:

#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

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/file-posix.c

    r14527 r14577  
    6868/* don't use pread/pwrite on old versions of uClibc because they're buggy.
    6969 * https://trac.transmissionbt.com/ticket/3826 */
    70 #ifdef __UCLIBC__
    71 #define TR_UCLIBC_CHECK_VERSION(major,minor,micro) \
    72   (__UCLIBC_MAJOR__ > (major) || \
    73    (__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ > (minor)) || \
    74    (__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ == (minor) && \
    75       __UCLIBC_SUBLEVEL__ >= (micro)))
    76 #if !TR_UCLIBC_CHECK_VERSION (0,9,28)
     70#if defined (__UCLIBC__) && !TR_UCLIBC_CHECK_VERSION (0, 9, 28)
    7771 #undef HAVE_PREAD
    7872 #undef HAVE_PWRITE
    79 #endif
    8073#endif
    8174
  • trunk/libtransmission/utils.h

    r14574 r14577  
    8181#ifndef __has_extension
    8282 #define __has_extension __has_feature
     83#endif
     84
     85#ifdef __UCLIBC__
     86 #define TR_UCLIBC_CHECK_VERSION(major, minor, micro) \
     87   (__UCLIBC_MAJOR__ > (major) || \
     88    (__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ > (minor)) || \
     89    (__UCLIBC_MAJOR__ == (major) && __UCLIBC_MINOR__ == (minor) && \
     90       __UCLIBC_SUBLEVEL__ >= (micro)))
     91#else
     92 #define TR_UCLIBC_CHECK_VERSION(major, minor, micro) 0
    8393#endif
    8494
  • trunk/libtransmission/variant.c

    r14534 r14577  
    4343#include "variant.h"
    4444#include "variant-common.h"
     45
     46/* don't use newlocale/uselocale on old versions of uClibc because they're buggy.
     47 * https://trac.transmissionbt.com/ticket/6006 */
     48#if defined (__UCLIBC__) && !TR_UCLIBC_CHECK_VERSION (0, 9, 34)
     49 #undef HAVE_USELOCALE
     50#endif
    4551
    4652/**
Note: See TracChangeset for help on using the changeset viewer.