Slightly tidied things up if connection failure.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1219 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
086c5cc873
commit
4bcd7c7d81
|
@ -137,7 +137,7 @@ int RemoteCamera::Connect()
|
||||||
{
|
{
|
||||||
if ( sd < 0 )
|
if ( sd < 0 )
|
||||||
{
|
{
|
||||||
sd = socket(hp->h_addrtype, SOCK_STREAM, 0);
|
sd = socket( hp->h_addrtype, SOCK_STREAM, 0 );
|
||||||
if ( sd < 0 )
|
if ( sd < 0 )
|
||||||
{
|
{
|
||||||
Error(( "Can't create socket: %s", strerror(errno) ));
|
Error(( "Can't create socket: %s", strerror(errno) ));
|
||||||
|
@ -147,6 +147,7 @@ int RemoteCamera::Connect()
|
||||||
if ( connect( sd, (struct sockaddr *)&sa, sizeof(sa) ) < 0 )
|
if ( connect( sd, (struct sockaddr *)&sa, sizeof(sa) ) < 0 )
|
||||||
{
|
{
|
||||||
Error(( "Can't connect to remote camera: %s", strerror(errno) ));
|
Error(( "Can't connect to remote camera: %s", strerror(errno) ));
|
||||||
|
Disconnect();
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue