[Libreoffice-commits] core.git: sal/osl
Stephan Bergmann
sbergman at redhat.com
Thu Nov 20 02:33:27 PST 2014
sal/osl/unx/file_misc.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 07113bc943ca117c8ebe4b94bfbfde58ea35d972
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Nov 20 11:31:46 2014 +0100
At least old Mac OS X does not know AT_FDCWD
...lets hope it is actually declared as a macro wherever it is known.
Change-Id: If541d02af3ac5d9ad4f0ac1cb4dd9f9f4550a78a
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index fd1d902..abb7a18 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -868,12 +868,15 @@ void attemptChangeMetadata( const sal_Char* pszFileName, mode_t nMode, time_t nA
{
struct utimbuf aTimeBuffer;
+#if !defined AT_FDCWD
+ if (!S_ISLNK(nMode) && chmod(pszFileName, nMode) < 0)
+#else
if ( fchmodat(AT_FDCWD, pszFileName, nMode, AT_SYMLINK_NOFOLLOW) < 0 )
+#endif
{
int e = errno;
SAL_INFO(
- "sal.osl",
- "fchmodat(" << pszFileName << ") failed with errno " << e);
+ "sal.osl", "chmod(" << pszFileName << ") failed with errno " << e);
}
// No way to change utime of a symlink itself:
More information about the Libreoffice-commits
mailing list