Improve output with bad setups (non-existing local proxy or remote non-proxy servers)

git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@137 bc163920-b10d-0410-b2c5-a5491ca2ceef
This commit is contained in:
Dag Wieers 2006-09-01 14:51:28 +00:00
parent fc95112e19
commit e6893458fe
3 changed files with 27 additions and 19 deletions

View file

@ -47,7 +47,10 @@ void message( char *s, ... )
*/
void my_perror( char *msg )
{
char *err = strerror( errno );
message( "Error! %s: %s\n", msg, err );
if (errno == 0) {
message( "error: %s.\n", msg );
} else {
char *errstr = strerror( errno );
message( "error: %s: [%d] %s\n", msg, errno, errstr );
}
}