Catch by const reference (remove Eclipse warnings)

(closes #245)
This commit is contained in:
Massimo Gengarelli
2012-04-19 21:33:11 +02:00
committed by Keith Winstein
parent fb6d07e566
commit 49fc21c8a3
4 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -172,7 +172,7 @@ Connection::Connection( const char *desired_ip, const char *desired_port ) /* se
if ( desired_ip_addr != INADDR_ANY ) {
try {
if ( try_bind( sock, desired_ip_addr, desired_port_no ) ) { return; }
} catch ( NetworkException e ) {
} catch ( const NetworkException& e ) {
struct in_addr sin_addr;
sin_addr.s_addr = desired_ip_addr;
fprintf( stderr, "Error binding to IP %s: %s: %s\n",
@@ -184,7 +184,7 @@ Connection::Connection( const char *desired_ip, const char *desired_port ) /* se
/* now try any local interface */
try {
if ( try_bind( sock, INADDR_ANY, desired_port_no ) ) { return; }
} catch ( NetworkException e ) {
} catch ( const NetworkException& e ) {
fprintf( stderr, "Error binding to any interface: %s: %s\n",
e.function.c_str(), strerror( e.the_errno ) );
throw; /* this time it's fatal */