r3430 - trunk/libmnetutil/source
erik at minisip.org
erik at minisip.org
Thu Sep 20 10:11:19 CEST 2007
Author: erik
Date: 2007-09-20 10:11:18 +0200 (Thu, 20 Sep 2007)
New Revision: 3430
Modified:
trunk/libmnetutil/source/NetworkException.cxx
Log:
libmnetutil:
- strerror_r exists in two flavours: POSIX and GNU specific. This fix
makes us use the GNU one only on GNU systems. Libmnetutil is more
portable this way.
Modified: trunk/libmnetutil/source/NetworkException.cxx
===================================================================
--- trunk/libmnetutil/source/NetworkException.cxx 2007-09-17 13:19:11 UTC (rev 3429)
+++ trunk/libmnetutil/source/NetworkException.cxx 2007-09-20 08:11:18 UTC (rev 3430)
@@ -56,8 +56,16 @@
#else
char buf[256];
buf[0]=0;
- const char *res = strerror_r( errorNumber, buf, sizeof( buf ) );
- msg = string( res );
+ #if defined(GNU)
+ int ret = strerror_r( errorNumber, buf, sizeof( buf ) );
+ msg = string( buf );
+
+ #else
+ if (strerror_r( errorNumber, buf, sizeof( buf ) ))
+ msg="Unknown error";
+ else
+ msg = string( buf );
+ #endif
#endif
};
More information about the Minisip-devel
mailing list