Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75133 - in trunk: boost/filesystem/v3 libs/filesystem/v3/src libs/filesystem/v3/test
From: bdawes_at_[hidden]
Date: 2011-10-27 11:37:12


Author: bemandawes
Date: 2011-10-27 11:37:11 EDT (Thu, 27 Oct 2011)
New Revision: 75133
URL: http://svn.boost.org/trac/boost/changeset/75133

Log:
Fix for old Sun compilers __SUNPRO_CC <= 0x5100 that don't fully support fchmodat. Fix test failure on some POSIX systems that grant write permission to group and others.
Text files modified:
   trunk/boost/filesystem/v3/operations.hpp | 4 ++--
   trunk/libs/filesystem/v3/src/operations.cpp | 3 ++-
   trunk/libs/filesystem/v3/test/operations_test.cpp | 2 +-
   3 files changed, 5 insertions(+), 4 deletions(-)

Modified: trunk/boost/filesystem/v3/operations.hpp
==============================================================================
--- trunk/boost/filesystem/v3/operations.hpp (original)
+++ trunk/boost/filesystem/v3/operations.hpp 2011-10-27 11:37:11 EDT (Thu, 27 Oct 2011)
@@ -145,9 +145,9 @@
   class BOOST_FILESYSTEM_DECL file_status
   {
   public:
- file_status() : m_value(status_error), m_perms(perms_not_known) {}
+ file_status() : m_value(status_error), m_perms(perms_not_known) {}
     explicit file_status(file_type v, perms prms = perms_not_known)
- : m_value(v), m_perms(prms) {}
+ : m_value(v), m_perms(prms) {}
 
     // observers
     file_type type() const { return m_value; }

Modified: trunk/libs/filesystem/v3/src/operations.cpp
==============================================================================
--- trunk/libs/filesystem/v3/src/operations.cpp (original)
+++ trunk/libs/filesystem/v3/src/operations.cpp 2011-10-27 11:37:11 EDT (Thu, 27 Oct 2011)
@@ -1393,7 +1393,8 @@
 
 # ifdef BOOST_POSIX_API
     // Mac OS X Lion and some other platforms don't support fchmodat()
-# if defined(AT_FDCWD) && defined(AT_SYMLINK_NOFOLLOW)
+# if defined(AT_FDCWD) && defined(AT_SYMLINK_NOFOLLOW) \
+ && (!defined(__SUNPRO_CC) || __SUNPRO_CC > 0x5100)
       if (::fchmodat(AT_FDCWD, p.c_str(), mode_cast(prms),
            !(prms & symlink_perms) ? 0 : AT_SYMLINK_NOFOLLOW))
 # else // fallback if fchmodat() not supported

Modified: trunk/libs/filesystem/v3/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/v3/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/v3/test/operations_test.cpp 2011-10-27 11:37:11 EDT (Thu, 27 Oct 2011)
@@ -816,7 +816,7 @@
     {
       cout << " fs::status(p).permissions() " << std::oct << fs::status(p).permissions()
         << std::dec << endl;
- BOOST_TEST(fs::status(p).permissions() == 0644);
+ BOOST_TEST((fs::status(p).permissions() & 0644) == 0644); // 0664 sometimes returned
       fs::permissions(p, fs::owner_all);
       BOOST_TEST(fs::status(p).permissions() == fs::owner_all);
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk