From 3615fbe9417c788297b52aa8a71601b945c0a265 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 18 Jan 2015 11:21:03 -0500 Subject: [PATCH] unlink/rmdir don't follow symbolic links, so use lstat instead of stat. --- toolbox/os.cpp | 2 +- toolbox/os_highlevel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolbox/os.cpp b/toolbox/os.cpp index 41df567..84a73b2 100644 --- a/toolbox/os.cpp +++ b/toolbox/os.cpp @@ -639,7 +639,7 @@ namespace OS int ok; - ok = ::stat(sname.c_str(), &st); + ok = ::lstat(sname.c_str(), &st); if (ok == 0) { if (S_ISDIR(st.st_mode)) diff --git a/toolbox/os_highlevel.cpp b/toolbox/os_highlevel.cpp index fddae53..ca655a3 100644 --- a/toolbox/os_highlevel.cpp +++ b/toolbox/os_highlevel.cpp @@ -345,7 +345,7 @@ namespace OS { 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(); int ok = 0;