mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
Make FileOutputBuffer fail early if you pass a directory.
Previously, it created a temporary directory and then failed when FileOutputBuffer tried to rename that file to the destination file (which is actually a directory name). Differential Revision: https://reviews.llvm.org/D30912 llvm-svn: 297679
This commit is contained in:
parent
d664044360
commit
034096e25d
@ -57,6 +57,8 @@ FileOutputBuffer::create(StringRef FilePath, size_t Size, unsigned Flags) {
|
||||
// FIXME: In posix, you use the access() call to check this.
|
||||
}
|
||||
break;
|
||||
case sys::fs::file_type::directory_file:
|
||||
return errc::is_a_directory;
|
||||
default:
|
||||
if (EC)
|
||||
return EC;
|
||||
|
Loading…
Reference in New Issue
Block a user