From 8a5e4982f9c536fafa4ae9b7c331ee656ded2fe5 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Tue, 25 Oct 2022 15:20:00 +1300 Subject: Fix lstat() for broken junction points on Windows. When using junction points to emulate symlinks on Windows, one edge case was not handled correctly by commit c5cb8f3b: if a junction point is broken (pointing to a non-existent path), we'd report ENOENT. This doesn't break any known use case, but was noticed while developing a test suite for these functions and is fixed here for completeness. Also add translation ERROR_CANT_RESOLVE_FILENAME -> ENOENT, as that is one of the errors Windows can report for some kinds of broken paths. Discussion: https://postgr.es/m/CA%2BhUKG%2BajSQ_8eu2AogTncOnZ5me2D-Cn66iN_-wZnRjLN%2Bicg%40mail.gmail.com (cherry picked from commit 387803d81d6256fcb60b9192bb5b00042442b4e3) Author: Thomas Munro Author: Alexandra Wang --- src/port/win32error.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/port/win32error.c') diff --git a/src/port/win32error.c b/src/port/win32error.c index 0e5f91adfa0..60253d1e3f3 100644 --- a/src/port/win32error.c +++ b/src/port/win32error.c @@ -164,6 +164,12 @@ static const struct }, { ERROR_DELETE_PENDING, ENOENT + }, + { + ERROR_INVALID_NAME, ENOENT + }, + { + ERROR_CANT_RESOLVE_FILENAME, ENOENT } }; -- cgit v1.2.3