+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>
* fhandler_process.cc (thread_info::fill_if_match): Reformat.
char *errstr = strerror_worker (errnum);
if (!errstr)
{
- __small_sprintf (errstr = _my_tls.locals.strerror_buf, "Unknown error %u",
- (unsigned) errnum);
+ __small_sprintf (errstr = _my_tls.locals.strerror_buf, "Unknown error %d",
+ errnum);
errno = _impure_ptr->_errno = EINVAL;
}
return errstr;
return ERANGE;
int result = 0;
char *error = strerror_worker (errnum);
+ char tmp[sizeof "Unknown error -2147483648"];
if (!error)
{
- __small_sprintf (error = _my_tls.locals.strerror_buf, "Unknown error %u",
- (unsigned) errnum);
+ __small_sprintf (error = tmp, "Unknown error %d", errnum);
result = EINVAL;
}
if (strlen (error) >= n)