unlink/rmdir don't follow symbolic links, so use lstat instead of stat.

This commit is contained in:
Kelvin Sherlock 2015-01-18 11:21:03 -05:00
parent 172da3e250
commit 3615fbe941
2 changed files with 2 additions and 2 deletions

View File

@ -639,7 +639,7 @@ namespace OS
int ok; int ok;
ok = ::stat(sname.c_str(), &st); ok = ::lstat(sname.c_str(), &st);
if (ok == 0) if (ok == 0)
{ {
if (S_ISDIR(st.st_mode)) if (S_ISDIR(st.st_mode))

View File

@ -345,7 +345,7 @@ namespace OS {
Log(" FSpDelete(%s)\n", sname.c_str()); Log(" FSpDelete(%s)\n", sname.c_str());
if (::stat(sname.c_str(), &st) < 0) if (::lstat(sname.c_str(), &st) < 0)
return macos_error_from_errno(); return macos_error_from_errno();
int ok = 0; int ok = 0;