diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-01-19 11:05:51 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-01-19 11:07:20 +0000 |
commit | 0c17acbb321ced2afe2f0ff6769291549838ebaa (patch) | |
tree | 3abb6f3ba42f3b25d4a2a91179d6978f03fc2f7f /sal | |
parent | Explicit type in SvStream::operator << call. (diff) | |
download | core-0c17acbb321ced2afe2f0ff6769291549838ebaa.tar.gz core-0c17acbb321ced2afe2f0ff6769291549838ebaa.zip |
fix SvStream to not disagree with sal on sizeof struct stat
A temporary tweak to restore build-ability; the oslDirectory
change needs a little more thought & public exposure, but rsc
no longer crashes during compile ...
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/osl/detail/file.h | 14 | ||||
-rw-r--r-- | sal/inc/osl/file.hxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/file_stat.cxx | 20 | ||||
-rw-r--r-- | sal/util/sal.map | 2 |
4 files changed, 25 insertions, 13 deletions
diff --git a/sal/inc/osl/detail/file.h b/sal/inc/osl/detail/file.h index 19415a2623fa..108d2306b36d 100644 --- a/sal/inc/osl/detail/file.h +++ b/sal/inc/osl/detail/file.h @@ -58,17 +58,13 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_openFilePath( oslFileHandle *pHandle, sal_uInt32 uFlags ); -/* Wrappers for stat() and lstat() with Android-specific hook - for files inside the .apk. -*/ +/* Compare directory items for being the same underlying file + * this unwinds unix hard-links and symlinks etc. + */ -SAL_DLLPUBLIC oslFileError SAL_CALL osl_statFilePath( - const char *cpFilePath, - struct stat *statb ); +SAL_DLLPUBLIC sal_Bool SAL_CALL osl_identicalDirectoryItem(oslDirectory a, oslDirectory b); -SAL_DLLPUBLIC oslFileError SAL_CALL osl_lstatFilePath( - const char *cpFilePath, - struct stat *statb ); +SAL_DLLPUBLIC oslFileError SAL_CALL osl_lstatFilePath( const char *cpFilePath, struct stat *statb ); /* Get the OS specific "handle" of an open file. */ diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx index e64e2f0aac71..d9a1d89fe84c 100644 --- a/sal/inc/osl/file.hxx +++ b/sal/inc/osl/file.hxx @@ -1389,9 +1389,9 @@ public: class DirectoryItem: public FileBase { - oslDirectoryItem _pData; public: + oslDirectoryItem _pData; /** Constructor. */ diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx index 9cbb39af0edc..0477a52e555a 100644 --- a/sal/osl/unx/file_stat.cxx +++ b/sal/osl/unx/file_stat.cxx @@ -448,15 +448,31 @@ oslFileError SAL_CALL osl_setFileTime ( return osl_psz_setFileTime( path, pCreationTime, pLastAccessTime, pLastWriteTime ); } -oslFileError -SAL_CALL osl_statFilePath( const char *cpFilePath, struct stat *statb ) +sal_Bool +SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b) { + DirectoryItem_Impl *pA = (DirectoryItem_Impl *) a; + DirectoryItem_Impl *pB = (DirectoryItem_Impl *) b; + if (a == b) + return sal_True; + /* same name => same item, unless renaming / moving madness has occurred */ + if (rtl_ustr_compare_WithLength( + pA->m_ustrFilePath->buffer, pA->m_ustrFilePath->length, + pB->m_ustrFilePath->buffer, pB->m_ustrFilePath->length ) == 0) + return sal_True; + + fprintf (stderr, "We have to do an inode compare !\n"); + + /* int rc = stat_c( cpFilePath, statb ); + Stat.st_ino == ... if (rc == -1) return oslTranslateFileError(OSL_FET_ERROR, errno); else return osl_File_E_None; + */ + return sal_False; } oslFileError diff --git a/sal/util/sal.map b/sal/util/sal.map index 879d252a9ee8..26c30fc03191 100644 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -648,7 +648,7 @@ PRIVATE_textenc.1 { # LibreOffice 3.6 PRIVATE_file.1 { # LibreOffice 3.6 global: osl_openFilePath; - osl_statFilePath; + osl_identicalDirectoryItem; osl_lstatFilePath; osl_getFileOSHandle; }; |