From: Vladimir Vishnevsky Date: Tue, 9 Feb 2021 10:25:38 +0000 (+0000) Subject: libstdc++: Fix build failure for targets without unistd.h X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adeaa43ad3bd8004c2521e1fb3bb0e08be33234b;p=gcc.git libstdc++: Fix build failure for targets without unistd.h The patch fixes build issues occurring if build parameter "--enable-cstdio=stdio_pure" is specified and no unistd.h is present in the environment. libstdc++-v3/ChangeLog: * include/ext/stdio_sync_filebuf.h: Remove unused . * src/c++17/fs_ops.cc (fs::permissions): Qualify mode_t. --- diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h index 178b471957a..90765e55831 100644 --- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h +++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h @@ -32,7 +32,6 @@ #pragma GCC system_header #include -#include #include #include // For __c_file #include // For __exchange diff --git a/libstdc++-v3/src/c++17/fs_ops.cc b/libstdc++-v3/src/c++17/fs_ops.cc index 72755c98a5a..04a559ab1d6 100644 --- a/libstdc++-v3/src/c++17/fs_ops.cc +++ b/libstdc++-v3/src/c++17/fs_ops.cc @@ -1130,7 +1130,7 @@ fs::permissions(const path& p, perms prms, perm_options opts, #else if (nofollow && is_symlink(st)) ec = std::make_error_code(std::errc::not_supported); - else if (posix::chmod(p.c_str(), static_cast(prms))) + else if (posix::chmod(p.c_str(), static_cast(prms))) err = errno; #endif