summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2012-06-23 05:07:59 +0000
committerTim Mayberry <mojofunk@gmail.com>2012-06-23 05:07:59 +0000
commit17475df100de18b01dee4c0d943fa2c26405bf4e (patch)
treeebe91e65c916dcbf89caa7fd185c80e49e966734 /libs
parent5ae32cdfd9d85b9202adfb7e4028c621c23000b2 (diff)
Rename PBD::sys::inodes_same to equivalent_paths
This better reflects its function and more closely matches boost naming(which is usually a good sign) git-svn-id: svn://localhost/ardour2/branches/3.0@12857 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/file_source.cc2
-rw-r--r--libs/ardour/session.cc2
-rw-r--r--libs/pbd/filesystem.cc8
-rw-r--r--libs/pbd/pbd/filesystem.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index d401caa037..ba2b809dbe 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -277,7 +277,7 @@ FileSource::find (Session& s, DataType type, const string& path, bool must_exist
++j;
while (j != hits.end()) {
- if (PBD::sys::inodes_same (*i, *j)) {
+ if (PBD::sys::equivalent_paths (*i, *j)) {
/* *i and *j are the same file; break out of the loop early */
break;
}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index a6a9041ab1..ed90bccb7f 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -4528,7 +4528,7 @@ Session::ensure_search_path_includes (const string& path, DataType type)
On Windows, I think we could just do if (*i == path) here.
*/
- if (PBD::sys::inodes_same (*i, path)) {
+ if (PBD::sys::equivalent_paths (*i, path)) {
return;
}
}
diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc
index fc4676a38d..244acefe43 100644
--- a/libs/pbd/filesystem.cc
+++ b/libs/pbd/filesystem.cc
@@ -221,12 +221,12 @@ get_absolute_path (const path & p)
/** @return true if a and b have the same inode */
bool
-inodes_same (const path& a, const path& b)
+equivalent_paths (const std::string& a, const std::string& b)
{
struct stat bA;
- int const rA = g_stat (a.to_string().c_str(), &bA);
+ int const rA = g_stat (a.c_str(), &bA);
struct stat bB;
- int const rB = g_stat (b.to_string().c_str(), &bB);
+ int const rB = g_stat (b.c_str(), &bB);
return (rA == 0 && rB == 0 && bA.st_dev == bB.st_dev && bA.st_ino == bB.st_ino);
}
@@ -239,7 +239,7 @@ bool
path_is_within (path const & haystack, path needle)
{
while (1) {
- if (inodes_same (haystack, needle)) {
+ if (equivalent_paths (haystack.to_string(), needle.to_string())) {
return true;
}
diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h
index aa9f9ef502..c347f3cc42 100644
--- a/libs/pbd/pbd/filesystem.h
+++ b/libs/pbd/pbd/filesystem.h
@@ -192,7 +192,7 @@ path get_absolute_path (const path &);
bool path_is_within (const path &, path);
-bool inodes_same (const path &, const path &);
+bool equivalent_paths (const std::string &, const std::string &);
} // namespace sys