From Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>:
Jessica Hamilton has uploaded this change for review. (
https://review.haiku-os.org/c/haiku/+/5325 ;)
Change subject: libroot_build: fix stat of files in a symlinked directory
......................................................................
libroot_build: fix stat of files in a symlinked directory
Only manifested itself with the host build tools, where looking
up a file inside a directory that is a symlink would fail, as the
cached stat info in NodeRef would fail to match the stat info to
check that the path still exists, as `lstat` returned the stat info
of the resolved symlink. Replacing `lstat` with `stat` fixes the
mismatching stat information cached in the NodeRef.
* Fixes #17750
Change-Id: I7cc360dd4678d2c4cf1186e9f39490a6bfd946a2
---
M src/build/libroot/fs.cpp
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://git.haiku-os.org:22/haiku refs/changes/25/5325/1
diff --git a/src/build/libroot/fs.cpp b/src/build/libroot/fs.cpp
index 3eed597..0e1cc40 100644
--- a/src/build/libroot/fs.cpp
+++ b/src/build/libroot/fs.cpp
@@ -369,7 +369,7 @@
// stat the path to check, if it is still valid
struct stat st;
- if (lstat(path.c_str(), &st) < 0) {
+ if (stat(path.c_str(), &st) < 0) {
sDirPathMap.erase(it);
return errno;
}
--
To view, visit https://review.haiku-os.org/c/haiku/+/5325
To unsubscribe, or for help writing mail filters, visit
https://review.haiku-os.org/settings
Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I7cc360dd4678d2c4cf1186e9f39490a6bfd946a2
Gerrit-Change-Number: 5325
Gerrit-PatchSet: 1
Gerrit-Owner: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Gerrit-MessageType: newchange