about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorHans Kratz <hans@appfour.com>2022-02-28 10:34:06 +0100
committerHans Kratz <hans@appfour.com>2022-03-04 13:33:35 +0100
commite42733307169708d78f4373c32ecfd4019c279ca (patch)
treec8360b990a926529c6304c3870ba0f058dd98a2a /compiler/rustc_codegen_llvm/src
parent97cde9fe08804a3a5208d77f6870ad7d43f8c9c3 (diff)
downloadrust-e42733307169708d78f4373c32ecfd4019c279ca.tar.gz
rust-e42733307169708d78f4373c32ecfd4019c279ca.zip
remove_dir_all(): try recursing first instead of trying to unlink()
This only affects the `slow` code path, if there is no `dirent.d_type` or if
the type is `DT_UNKNOWN`.

POSIX specifies that calling `unlink()` or `unlinkat(..., 0)` on a directory can
succeed:
> "The _path_ argument shall not name a directory unless the process has
> appropriate privileges and the implementation supports using _unlink()_ on
> directories."
This however can cause orphaned directories requiring an fsck e.g. on Illumos
UFS, so we have to avoid that in the common case. We now just try to recurse
into it first and unlink() if we can't open it as a directory.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions