Skip to content

Commit d1be191

Browse files
committed
fix issue in test with symlinks.
libruby.so.4.0 is a symlink whose target (libruby.so.4.0.0 or similar) doesn't exist in the extracted temp dir — it's a dangling symlink. stat() follows symlinks and fails with ENOENT on dangling ones. lstat() operates on the symlink itself and succeeds, then unlink() removes the symlink cleanly.
1 parent 53ebdc3 commit d1be191

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/system_utils_posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ bool DeleteRecursively(const char *path) {
251251
}
252252

253253
struct stat st;
254-
if (stat(path, &st) < 0) {
254+
if (lstat(path, &st) < 0) {
255255
FATAL("DeleteRecursively: stat(\"%s\") failed: %s", path, strerror(errno));
256256
return false;
257257
}

0 commit comments

Comments
 (0)