Skip to content

Commit

Permalink
Do not shadow global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
paveljanik committed Sep 2, 2016
1 parent cbe9ae8 commit 7c069a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,19 +601,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
}
Expand Down
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,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);
Expand Down

0 comments on commit 7c069a7

Please sign in to comment.