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
5
third_party/libcxx/fs/file_descriptor.h
vendored
5
third_party/libcxx/fs/file_descriptor.h
vendored
|
@ -194,7 +194,12 @@ inline perms posix_get_perms(const StatT& st) noexcept { return static_cast<perm
|
|||
inline file_status create_file_status(error_code& m_ec, path const& p, const StatT& path_stat, error_code* ec) {
|
||||
if (ec)
|
||||
*ec = m_ec;
|
||||
#ifdef __COSMOPOLITAN__
|
||||
if (m_ec && (m_ec.value() == (int)errc::no_such_file_or_directory ||
|
||||
m_ec.value() == (int)errc::not_a_directory)) {
|
||||
#else
|
||||
if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) {
|
||||
#endif
|
||||
return file_status(file_type::not_found);
|
||||
} else if (m_ec) {
|
||||
ErrorHandler<void> err("posix_stat", ec, &p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue