fflush() followed by fclose() is redundant

Change-Id: Iacb9332635cb6afa90ec1a72e96388b3b5b7b56c
Reviewed-on: https://gerrit.libreoffice.org/52420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Takeshi Abe
2018-04-05 00:39:05 +09:00
committed by Noel Grandin
parent 8d6e498a11
commit 786a1c8ef1
3 changed files with 1 additions and 6 deletions

View File

@@ -202,9 +202,8 @@ bool copyFile(const OString* source, const OString& target)
if (source != nullptr) { if (source != nullptr) {
fclose(pSource); fclose(pSource);
} }
if ( fflush(pTarget) ) if ( fclose(pTarget) )
bRet = false; bRet = false;
fclose(pTarget);
return bRet; return bRet;
} }

View File

@@ -129,7 +129,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
fprintf( fp, "[%p]\n", *pFramePtr ); fprintf( fp, "[%p]\n", *pFramePtr );
} }
fflush( fp );
fclose( fp ); fclose( fp );
} }
} }
@@ -209,7 +208,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
} }
fprintf( fp, "[%p]\n", *pFramePtr ); fprintf( fp, "[%p]\n", *pFramePtr );
} }
fflush( fp );
fclose( fp ); fclose( fp );
} }
} }
@@ -277,7 +275,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
fprintf( fp, "[%p]\n", *pFramePtr ); fprintf( fp, "[%p]\n", *pFramePtr );
} }
fflush( fp );
fclose( fp ); fclose( fp );
} }
} }

View File

@@ -131,7 +131,6 @@ void exportToFile(
FILE * f = ::fopen( fname, "w" ); FILE * f = ::fopen( fname, "w" );
::fwrite( bytes.getConstArray(), 1, bytes.getLength(), f ); ::fwrite( bytes.getConstArray(), 1, bytes.getLength(), f );
::fflush( f );
::fclose( f ); ::fclose( f );
} }