fix warning regarding unused return value

This commit is contained in:
Guenter Obiltschnig 2017-02-14 13:46:03 +01:00
parent bd82bb1306
commit 1a7a1810f6

View File

@ -1,7 +1,7 @@
//
// Error.cpp
//
// $Id: //poco/1.4/Foundation/src/Error.cpp#3 $
// $Id: //poco/1.7/Foundation/src/Error.cpp#3 $
//
// Library: Foundation
// Package: Core
@ -66,10 +66,10 @@ namespace Poco {
without -D_GNU_SOURCE is needed, otherwise the GNU version is
preferred.
*/
#if (_XOPEN_SOURCE >= 600) || POCO_ANDROID
#if ((_XOPEN_SOURCE >= 600) && ! _GNU_SOURCE) || POCO_ANDROID
char errmsg[256] = "";
strerror_r(errorCode, errmsg, 256);
return errmsg;
int rc = strerror_r(errorCode, errmsg, 256);
return rc == 0 ? std::string(errmsg) : std::string();
#elif defined _GNU_SOURCE
char errmsg[256] = "";
return std::string(strerror_r(errorCode, errmsg, 256));