@ -385,14 +385,15 @@ void db_close_stream(output_t *op) {
return ;
return ;
}
}
fseek ( f , 0 , SEEK_END ) ;
fseek ( f , 0 , SEEK_END ) ;
stream . len = ftell ( f ) ;
if ( stream . len < 0 ) {
long pos = ftell ( f ) ;
if ( pos < 0 ) {
ilog ( LOG_ERR , " Failed to get file position: %s " , strerror ( errno ) ) ;
ilog ( LOG_ERR , " Failed to get file position: %s " , strerror ( errno ) ) ;
fclose ( f ) ;
fclose ( f ) ;
if ( ( output_storage & OUTPUT_STORAGE_FILE ) )
if ( ( output_storage & OUTPUT_STORAGE_FILE ) )
goto file ;
goto file ;
return ;
return ;
}
}
stream . len = pos ;
fseek ( f , 0 , SEEK_SET ) ;
fseek ( f , 0 , SEEK_SET ) ;
stream . s = malloc ( stream . len ) ;
stream . s = malloc ( stream . len ) ;
if ( stream . s ) {
if ( stream . s ) {