forked from OSchip/llvm-project
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:
parent
96d5dc77fa
commit
79fdb75a34
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue