Author: mturk Date: Mon Apr 18 14:41:35 2011 New Revision: 1094601 URL: http://svn.apache.org/viewvc?rev=1094601&view=rev Log: No need for thread local support
Modified: commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c Modified: commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c?rev=1094601&r1=1094600&r2=1094601&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/port/bsdstring.c Mon Apr 18 14:41:35 2011 @@ -125,18 +125,17 @@ static const char *const _posix_siglist[ 0 }; -static ACR_THREAD char _strsignal_buf[_NUM_SIGSNALS]; char *_bsd_strsignal(int signum) { - int saved = errno; + static char _strsignal_buf[32]; + if (signum >= 0 && signum < _NUM_SIGSNALS) - strncpy(_strsignal_buf, _posix_siglist[signum], - sizeof(_strsignal_buf)); - else + return (char *)_posix_siglist[signum]; + else { + int saved = errno; snprintf(_strsignal_buf, sizeof(_strsignal_buf), "Unknown signal (%d)", signum); - - errno = saved; - return _strsignal_buf; + errno = saved; + return _strsignal_buf; + } } -