aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-07 20:37:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-07 20:37:17 +0000
commit130f1ca3b3f048a02ec3590db8006604a762109c (patch)
tree1637f4ba9d888a45b327fd296a9028a69b746d9b
parentb0b42d3c42bc1dba69dfc6d002153b22e8082dbd (diff)
downloadpaludis-130f1ca3b3f048a02ec3590db8006604a762109c.tar.gz
paludis-130f1ca3b3f048a02ec3590db8006604a762109c.tar.xz
Attempt two at BSD realpath
-rw-r--r--paludis/util/fs_entry.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index 4e4c1b0..003680c 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -378,7 +378,10 @@ FSEntry::realpath() const
throw FSError("Could not resolve path '" + _path + "'");
if (! ::realpath(_path.c_str(), r))
throw FSError("Could not resolve path '" + _path + "'");
- return FSEntry(r);
+ FSEntry result(r);
+ if (! result.exists())
+ throw FSError("Could not resolve path '" + _path + "'");
+ return result;
#endif
}
@@ -401,7 +404,10 @@ FSEntry::realpath_if_exists() const
return *this;
if (! ::realpath(_path.c_str(), r))
return *this;
- return FSEntry(r);
+ FSEntry result(r);
+ if (! result.exists())
+ return *this;
+ return result;
#endif
}