strerror: match recent glibc changes
* errno.cc (strerror): Print unknown errno as int. (__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
This commit is contained in:
parent
38aa65b899
commit
4d95630803
|
@ -1,3 +1,8 @@
|
||||||
|
2011-05-23 Eric Blake <eblake@redhat.com>
|
||||||
|
|
||||||
|
* errno.cc (strerror): Print unknown errno as int.
|
||||||
|
(__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
|
||||||
|
|
||||||
2011-05-23 Corinna Vinschen <corinna@vinschen.de>
|
2011-05-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_process.cc (thread_info::fill_if_match): Reformat.
|
* fhandler_process.cc (thread_info::fill_if_match): Reformat.
|
||||||
|
|
|
@ -382,8 +382,8 @@ strerror (int errnum)
|
||||||
char *errstr = strerror_worker (errnum);
|
char *errstr = strerror_worker (errnum);
|
||||||
if (!errstr)
|
if (!errstr)
|
||||||
{
|
{
|
||||||
__small_sprintf (errstr = _my_tls.locals.strerror_buf, "Unknown error %u",
|
__small_sprintf (errstr = _my_tls.locals.strerror_buf, "Unknown error %d",
|
||||||
(unsigned) errnum);
|
errnum);
|
||||||
errno = _impure_ptr->_errno = EINVAL;
|
errno = _impure_ptr->_errno = EINVAL;
|
||||||
}
|
}
|
||||||
return errstr;
|
return errstr;
|
||||||
|
@ -409,10 +409,10 @@ __xpg_strerror_r (int errnum, char *buf, size_t n)
|
||||||
return ERANGE;
|
return ERANGE;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
char *error = strerror_worker (errnum);
|
char *error = strerror_worker (errnum);
|
||||||
|
char tmp[sizeof "Unknown error -2147483648"];
|
||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
__small_sprintf (error = _my_tls.locals.strerror_buf, "Unknown error %u",
|
__small_sprintf (error = tmp, "Unknown error %d", errnum);
|
||||||
(unsigned) errnum);
|
|
||||||
result = EINVAL;
|
result = EINVAL;
|
||||||
}
|
}
|
||||||
if (strlen (error) >= n)
|
if (strlen (error) >= n)
|
||||||
|
|
Loading…
Reference in New Issue