diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-11-20 11:31:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-20 11:31:46 +0100 |
commit | 07113bc943ca117c8ebe4b94bfbfde58ea35d972 (patch) | |
tree | 320825707707c06716699bb787feea3dfe41113b /sal/osl/unx | |
parent | b8689142a9760132e43eaffe9d54801ed18fb76b (diff) |
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
Diffstat (limited to 'sal/osl/unx')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index fd1d902566cb..abb7a184df39 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: |