summaryrefslogtreecommitdiff
path: root/sal/osl/unx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-01-19 17:03:16 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-01-19 17:04:03 +0000
commitc5d4f4967e5d9d0220fadf3f313ddc35002cdf27 (patch)
tree74f5f2a3fe2a3a5108ea5d96978c320325629d9d /sal/osl/unx
parent80a1001a206a3e3b6bf83b9734580cc7f46b0e33 (diff)
implement inode compare for identical directory item checking
Diffstat (limited to 'sal/osl/unx')
-rw-r--r--sal/osl/unx/file_stat.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index 320744fc0357..e5fc091ad995 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -461,17 +461,17 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b)
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 );
+#if defined(__GNUC__) && (__GNUC__ < 3)
+ struct ::stat a_stat, b_stat;
+#else
+ struct stat a_stat, b_stat;
+#endif
- Stat.st_ino == ...
- if (rc == -1)
- return oslTranslateFileError(OSL_FET_ERROR, errno);
- else
- return osl_File_E_None;
- */
- return sal_False;
+ if (osl::lstat(rtl::OUString(pA->m_ustrFilePath), a_stat) != 0 ||
+ osl::lstat(rtl::OUString(pB->m_ustrFilePath), b_stat) != 0)
+ return sal_False;
+
+ return (a_stat.st_ino == b_stat.st_ino);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */