libstdc++: Fix build failure for targets without unistd.h
authorVladimir Vishnevsky <vv.os.swe@gmail.com>
Tue, 9 Feb 2021 10:25:38 +0000 (10:25 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 9 Feb 2021 12:31:52 +0000 (12:31 +0000)
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 <unistd.h>.
* src/c++17/fs_ops.cc (fs::permissions): Qualify mode_t.

libstdc++-v3/include/ext/stdio_sync_filebuf.h
libstdc++-v3/src/c++17/fs_ops.cc

index 178b471957abd3e96dc0591ad748ac82fa33cf29..90765e5583154b4cd7cf8ec5c34fb30ba1a9059d 100644 (file)
@@ -32,7 +32,6 @@
 #pragma GCC system_header
 
 #include <streambuf>
-#include <unistd.h>
 #include <cstdio>
 #include <bits/c++io.h>  // For __c_file
 #include <bits/move.h>   // For __exchange
index 72755c98a5a4090e678e84882ee743a2874dbb3e..04a559ab1d62a94d770b235bb46cd852abbd905a 100644 (file)
@@ -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<mode_t>(prms)))
+  else if (posix::chmod(p.c_str(), static_cast<posix::mode_t>(prms)))
     err = errno;
 #endif