From 6c158aa448e084112b768fd9bc3306b64102d537 Mon Sep 17 00:00:00 2001 From: Vladimir Vishnevsky Date: Sat, 6 Feb 2021 12:25:24 +0100 Subject: [PATCH] libstdc++: Fix build failure for targets without unistd.h The patch fixes build issues occuring if build parameter "--enable-cstdio=stdio_pure" is specified and no unistd.h is present in the environment. 2021-02-07 Vladimir Vishnevsky libstdc++-v3/ChangeLog: Fix build failure for targets without unistd.h. * include/ext/stdio_sync_filebuf.h: Unused include removed. * src/c++17/fs_ops.cc: Namespace specified for mode_t. --- libstdc++-v3/include/ext/stdio_sync_filebuf.h | 1 - libstdc++-v3/src/c++17/fs_ops.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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 -- 2.17.1