Bug 402 - Added errors and warnings on bogus exits.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2097 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2007-04-03 09:47:08 +00:00
parent 9f63b75c88
commit 3e8d503681
3 changed files with 39 additions and 0 deletions

View File

@ -617,7 +617,10 @@ int Monitor::actionBrightness( int p_brightness )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to set brightness" ));
return( -1 );
}
}
}
else
@ -629,7 +632,10 @@ int Monitor::actionBrightness( int p_brightness )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to get brightness" ));
return( -1 );
}
}
}
return( shared_data->brightness );
@ -651,7 +657,10 @@ int Monitor::actionContrast( int p_contrast )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to set contrast" ));
return( -1 );
}
}
}
else
@ -663,7 +672,10 @@ int Monitor::actionContrast( int p_contrast )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to get contrast" ));
return( -1 );
}
}
}
return( shared_data->contrast );
@ -685,7 +697,10 @@ int Monitor::actionHue( int p_hue )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to set hue" ));
return( -1 );
}
}
}
else
@ -697,7 +712,10 @@ int Monitor::actionHue( int p_hue )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to get hue" ));
return( -1 );
}
}
}
return( shared_data->hue );
@ -719,7 +737,10 @@ int Monitor::actionColour( int p_colour )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to set colour" ));
return( -1 );
}
}
}
else
@ -731,7 +752,10 @@ int Monitor::actionColour( int p_colour )
if ( wait_loops-- )
usleep( 100000 );
else
{
Warning(( "Timed out waiting to get colour" ));
return( -1 );
}
}
}
return( shared_data->colour );

View File

@ -291,6 +291,7 @@ int RemoteCamera::GetResponse()
int buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error(( "Unable to read header data" ));
return( -1 );
}
if ( !header_expr )
@ -473,6 +474,7 @@ int RemoteCamera::GetResponse()
int buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error(( "Unable to read content" ));
return( -1 );
}
}
@ -485,6 +487,7 @@ int RemoteCamera::GetResponse()
int buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error(( "Unable to read content" ));
return( -1 );
}
static RegExpr *content_expr = 0;
@ -619,6 +622,7 @@ int RemoteCamera::GetResponse()
int buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error(( "Unable to read header" ));
return( -1 );
}
@ -930,6 +934,7 @@ int RemoteCamera::GetResponse()
int buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error(( "Unable to read subheader" ));
return( -1 );
}
state = SUBHEADERCONT;
@ -973,6 +978,7 @@ int RemoteCamera::GetResponse()
int buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error(( "Unable to read content" ));
return( -1 );
}
}
@ -987,6 +993,7 @@ int RemoteCamera::GetResponse()
int buffer_size = buffer.Size();
if ( buffer_len < 0 )
{
Error(( "Unable to read content" ));
return( -1 );
}
if ( buffer_len )
@ -1058,6 +1065,7 @@ int RemoteCamera::PreCapture()
Connect();
if ( sd < 0 )
{
Error(( "Unable to connect to camera" ));
return( -1 );
}
mode = SINGLE_IMAGE;
@ -1067,6 +1075,7 @@ int RemoteCamera::PreCapture()
{
if ( SendRequest() < 0 )
{
Error(( "Unable to send request" ));
Disconnect();
return( -1 );
}
@ -1079,6 +1088,7 @@ int RemoteCamera::PostCapture( Image &image )
int content_length = GetResponse();
if ( content_length < 0 )
{
Error(( "Unable to get response" ));
Disconnect();
return( -1 );
}
@ -1088,6 +1098,7 @@ int RemoteCamera::PostCapture( Image &image )
{
if ( !image.DecodeJpeg( buffer.Extract( content_length ), content_length ) )
{
Error(( "Unable to decode jpeg" ));
Disconnect();
return( -1 );
}
@ -1108,6 +1119,7 @@ int RemoteCamera::PostCapture( Image &image )
{
if ( !image.Unzip( buffer.Extract( content_length ), content_length ) )
{
Error(( "Unable to unzip RGB image" ));
Disconnect();
return( -1 );
}

View File

@ -194,6 +194,7 @@ int main( int argc, char *argv[] )
if ( monitors[0]->PrimeCapture() < 0 )
{
Error(( "Failed to prime capture of initial monitor" ));
exit( -1 );
}
@ -244,10 +245,12 @@ int main( int argc, char *argv[] )
{
if ( monitors[i]->PreCapture() < 0 )
{
Error(( "Failed to pre-capture monitor %d", i ));
exit( -1 );
}
if ( monitors[i]->PostCapture() < 0 )
{
Error(( "Failed to post-capture monitor %d", i ));
exit( -1 );
}