From 97b63420dda8706732da99540bf4c393498ed22c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 21 Sep 2016 14:13:33 +0200 Subject: [PATCH] Merge #8656: Trivial: Do not shadow global variable fileout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7c069a7 Do not shadow global variable (Pavel Janík) --- src/util.cpp | 12 ++++++------ src/util.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 26b804a94c..0520395bd3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -701,19 +701,19 @@ bool TryCreateDirectory(const boost::filesystem::path& p) return false; } -void FileCommit(FILE *fileout) +void FileCommit(FILE *file) { - fflush(fileout); // harmless if redundantly called + fflush(file); // harmless if redundantly called #ifdef WIN32 - HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout)); + HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file)); FlushFileBuffers(hFile); #else #if defined(__linux__) || defined(__NetBSD__) - fdatasync(fileno(fileout)); + fdatasync(fileno(file)); #elif defined(__APPLE__) && defined(F_FULLFSYNC) - fcntl(fileno(fileout), F_FULLFSYNC, 0); + fcntl(fileno(file), F_FULLFSYNC, 0); #else - fsync(fileno(fileout)); + fsync(fileno(file)); #endif #endif } diff --git a/src/util.h b/src/util.h index d02846ff63..a61e2797b5 100644 --- a/src/util.h +++ b/src/util.h @@ -114,7 +114,7 @@ bool error(const char* fmt, const Args&... args) void PrintExceptionContinue(const std::exception *pex, const char* pszThread); void ParseParameters(int argc, const char*const argv[]); -void FileCommit(FILE *fileout); +void FileCommit(FILE *file); bool TruncateFile(FILE *file, unsigned int length); int RaiseFileDescriptorLimit(int nMinFD); void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length);