fix for mantis 297

This commit is contained in:
Jeff Hill
2007-08-23 17:46:28 +00:00
parent a8d4a7a879
commit de1b8a94ff
15 changed files with 56 additions and 50 deletions

View File

@@ -97,7 +97,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
if ( this->sock == INVALID_SOCKET ) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
this->printf (
this->printFormated (
"ca_client_context: unable to create "
"datagram socket because = \"%s\"\n",
sockErrBuf );
@@ -112,7 +112,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( this->sock );
this->printf (
this->printFormated (
"%s: non blocking IO set fail because \"%s\"\n",
__FILE__, sockErrBuf );
throwWithLocation ( noSocket () );
@@ -132,7 +132,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy (this->sock);
this->printf (
this->printFormated (
"CAC: unable to bind to an unconstrained "
"address because = \"%s\"\n",
sockErrBuf );
@@ -148,12 +148,12 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( this->sock );
this->printf ( "CAC: getsockname () error was \"%s\"\n", sockErrBuf );
this->printFormated ( "CAC: getsockname () error was \"%s\"\n", sockErrBuf );
throwWithLocation ( noSocket () );
}
if ( tmpAddr.sa.sa_family != AF_INET) {
epicsSocketDestroy ( this->sock );
this->printf ( "CAC: UDP socket was not inet addr family\n" );
this->printFormated ( "CAC: UDP socket was not inet addr family\n" );
throwWithLocation ( noSocket () );
}
this->localPort = htons ( tmpAddr.ia.sin_port );
@@ -256,7 +256,7 @@ void ca_client_context::registerForFileDescriptorCallBack (
// should block here until releated callback in progress completes
}
int ca_client_context::printf (
int ca_client_context :: printFormated (
const char *pformat, ... ) const
{
va_list theArgs;
@@ -264,14 +264,14 @@ int ca_client_context::printf (
va_start ( theArgs, pformat );
status = this->ca_client_context::vPrintf ( pformat, theArgs );
status = this->ca_client_context :: varArgsPrintFormated ( pformat, theArgs );
va_end ( theArgs );
return status;
}
int ca_client_context::vPrintf (
int ca_client_context :: varArgsPrintFormated (
const char *pformat, va_list args ) const // X aCC 361
{
caPrintfFunc * pFunc;
@@ -283,7 +283,7 @@ int ca_client_context::vPrintf (
return ( *pFunc ) ( pformat, args );
}
else {
return ::vfprintf ( stderr, pformat, args );
return :: vfprintf ( stderr, pformat, args );
}
}
@@ -359,8 +359,9 @@ void ca_client_context::signal ( int ca_status, const char * pfilenm,
va_end ( theArgs );
}
void ca_client_context::vSignal ( int ca_status, const char *pfilenm,
int lineno, const char *pFormat, va_list args )
void ca_client_context :: vSignal (
int ca_status, const char *pfilenm,
int lineno, const char *pFormat, va_list args )
{
static const char *severity[] =
{
@@ -374,27 +375,27 @@ void ca_client_context::vSignal ( int ca_status, const char *pfilenm,
"Fatal"
};
this->printf ( "CA.Client.Exception...............................................\n" );
this->printFormated ( "CA.Client.Exception...............................................\n" );
this->printf ( " %s: \"%s\"\n",
this->printFormated ( " %s: \"%s\"\n",
severity[ CA_EXTRACT_SEVERITY ( ca_status ) ],
ca_message ( ca_status ) );
if ( pFormat ) {
this->printf ( " Context: \"" );
this->vPrintf ( pFormat, args );
this->printf ( "\"\n" );
this->printFormated ( " Context: \"" );
this->varArgsPrintFormated ( pFormat, args );
this->printFormated ( "\"\n" );
}
if ( pfilenm ) {
this->printf ( " Source File: %s line %d\n",
this->printFormated ( " Source File: %s line %d\n",
pfilenm, lineno );
}
epicsTime current = epicsTime::getCurrent ();
char date[64];
current.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
this->printf ( " Current Time: %s\n", date );
this->printFormated ( " Current Time: %s\n", date );
/*
* Terminate execution if unsuccessful
@@ -405,7 +406,7 @@ void ca_client_context::vSignal ( int ca_status, const char *pfilenm,
abort ();
}
this->printf ( "..................................................................\n" );
this->printFormated ( "..................................................................\n" );
}
void ca_client_context::show ( unsigned level ) const