diff --git a/Csocket.cpp b/Csocket.cpp index 5b66a838..a23161d6 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.60 $ +* $Revision: 1.61 $ */ #include "Csocket.h" @@ -390,17 +390,17 @@ void SSLErrors( const char *filename, u_int iLineNum ) } #endif /* HAVE_LIBSSL */ -void __Perror( const CS_STRING & s ) +void __Perror( const CS_STRING & s, const char *pszFile, unsigned int iLineNo ) { #if defined(__sun) || defined(_WIN32) || __NetBSD_Version__ < 4000000000 - CS_DEBUG( s << ": " << strerror( GetSockError() ) ); + std::cerr << s << "(" << pszFile << ":" << iLineNo << "): " << strerror( GetSockError() ) << endl; #else char buff[512]; memset( (char *)buff, '\0', 512 ); if ( strerror_r( GetSockError(), buff, 511 ) == 0 ) - CS_DEBUG( s << ": " << buff ); + std::cerr << s << "(" << pszFile << ":" << iLineNo << "): " << buff << endl; else - CS_DEBUG( s << ": Unknown Error Occured" ); + std::cerr << s << "(" << pszFile << ":" << iLineNo << "): Unknown Error Occured " << endl; #endif /* __sun */ } diff --git a/Csocket.h b/Csocket.h index ac4d451b..811dee8a 100644 --- a/Csocket.h +++ b/Csocket.h @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.177 $ +* $Revision: 1.178 $ */ // note to compile with win32 need to link to winsock2, using gcc its -lws2_32 @@ -102,7 +102,7 @@ #endif /* CS_DEBUG */ #ifdef __DEBUG__ -# define PERROR( f ) __Perror( f ) +# define PERROR( f ) __Perror( f, __FILE__, __LINE__ ) #else # define PERROR( f ) (void)0 #endif /* __DEBUG__ */ @@ -377,7 +377,7 @@ inline void TFD_CLR( u_int iSock, fd_set *set ) FD_CLR( iSock, set ); } -void __Perror( const CS_STRING & s ); +void __Perror( const CS_STRING & s, const char *pszFile, unsigned int iLineNo ); unsigned long long millitime();