mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 04:14:03 +08:00
Make FileEntry::closeFile public
If you request that the file manager not close your file immediately after reading, it's useful to be able to close it later to prevent a file descriptor leak. llvm-svn: 228407
This commit is contained in:
@@ -73,10 +73,6 @@ class FileEntry {
|
||||
mutable std::unique_ptr<vfs::File> File;
|
||||
friend class FileManager;
|
||||
|
||||
void closeFile() const {
|
||||
File.reset(); // rely on destructor to close File
|
||||
}
|
||||
|
||||
void operator=(const FileEntry &) LLVM_DELETED_FUNCTION;
|
||||
|
||||
public:
|
||||
@@ -109,6 +105,10 @@ public:
|
||||
/// \brief Check whether the file is a named pipe (and thus can't be opened by
|
||||
/// the native FileManager methods).
|
||||
bool isNamedPipe() const { return IsNamedPipe; }
|
||||
|
||||
void closeFile() const {
|
||||
File.reset(); // rely on destructor to close File
|
||||
}
|
||||
};
|
||||
|
||||
struct FileData;
|
||||
|
||||
Reference in New Issue
Block a user