mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +00:00
Add special errno handling to libcxx
This commit is contained in:
parent
0f486a13c8
commit
2c4b88753b
10 changed files with 235 additions and 7 deletions
8
third_party/libcxx/fs/directory_iterator.cpp
vendored
8
third_party/libcxx/fs/directory_iterator.cpp
vendored
|
@ -118,7 +118,11 @@ public:
|
|||
if ((__stream_ = ::opendir(root.c_str())) == nullptr) {
|
||||
ec = detail::capture_errno();
|
||||
const bool allow_eacces = bool(opts & directory_options::skip_permission_denied);
|
||||
#ifdef __COSMOPOLITAN__
|
||||
if (allow_eacces && ec.value() == (int)errc::permission_denied)
|
||||
#else
|
||||
if (allow_eacces && ec.value() == EACCES)
|
||||
#endif
|
||||
ec.clear();
|
||||
return;
|
||||
}
|
||||
|
@ -307,7 +311,11 @@ bool recursive_directory_iterator::__try_recursion(error_code* ec) {
|
|||
}
|
||||
if (m_ec) {
|
||||
const bool allow_eacess = bool(__imp_->__options_ & directory_options::skip_permission_denied);
|
||||
#ifdef __COSMOPOLITAN__
|
||||
if (m_ec.value() == (int)errc::permission_denied && allow_eacess) {
|
||||
#else
|
||||
if (m_ec.value() == EACCES && allow_eacess) {
|
||||
#endif
|
||||
if (ec)
|
||||
ec->clear();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue