Applied patch from 'mitch' to improve error detection when streaming.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2864 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan
2009-05-08 09:47:37 +00:00
parent cc8d84a6a7
commit ca858a8562
3 changed files with 2171 additions and 2165 deletions

View File

@@ -1235,7 +1235,7 @@ bool EventStream::sendFrame( int delta_us )
break;
}
fprintf( stdout, "Content-Length: %d\r\n\r\n", img_buffer_size );
if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) < 0 )
if ( fwrite( img_buffer, img_buffer_size, 1, stdout ) != 1 )
{
Error( "Unable to send stream frame: %s", strerror(errno) );
return( false );

View File

@@ -295,7 +295,7 @@ bool Image::WriteRaw( const char *filename ) const
return( false );
}
if ( fwrite( buffer, size, 1, outfile ) < 1 )
if ( fwrite( buffer, size, 1, outfile ) != 1 )
{
Error( "Unable to write to '%s': %s", filename, strerror(errno) );
return( false );

View File

File diff suppressed because it is too large Load Diff