Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-05-24 00:43:06 +0400
committerEric Blake <eblake@redhat.com>2011-05-24 00:43:06 +0400
commit4d956308034df1849bc16381a3639876603ef107 (patch)
tree0f9b9859dbb8a9000a94d9d6a35451b3650be1d9 /winsup/cygwin/errno.cc
parent38aa65b899682ff6e9546b2ade2598d5b719b20a (diff)
strerror: match recent glibc changes
* errno.cc (strerror): Print unknown errno as int. (__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
Diffstat (limited to 'winsup/cygwin/errno.cc')
-rw-r--r--winsup/cygwin/errno.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc
index e881fc649..aa311b7e2 100644
--- a/winsup/cygwin/errno.cc
+++ b/winsup/cygwin/errno.cc
@@ -382,8 +382,8 @@ strerror (int errnum)
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;
@@ -409,10 +409,10 @@ __xpg_strerror_r (int errnum, char *buf, size_t n)
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)