mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
obuspa: Return the error when XSI-compliant strerror_r() fails
This commit is contained in:
parent
cf8c202d01
commit
083ffd8a3f
1 changed files with 15 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/src/core/usp_err.c b/src/core/usp_err.c
|
||||
index 1626e58..6db1d42 100755
|
||||
--- a/src/core/usp_err.c
|
||||
+++ b/src/core/usp_err.c
|
||||
@@ -189,7 +189,9 @@ char *USP_ERR_ToString(int err, char *buf, int len)
|
||||
{
|
||||
#if HAVE_STRERROR_R && !STRERROR_R_CHAR_P
|
||||
// XSI version of strerror_r
|
||||
- strerror_r(err, buf, len);
|
||||
+ if (strerror_r(err, buf, len) != 0) {
|
||||
+ snprintf(buf, len, "Unknown error %d", err);
|
||||
+ }
|
||||
return buf;
|
||||
#else
|
||||
// GNU version of strerror_r
|
||||
Loading…
Add table
Reference in a new issue