summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-03-15 19:42:43 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-23 13:00:37 -0400
commit7a6577513633b943202fc82ab7aa162e1d293c0a (patch)
tree704cdebde25170300f9d244582957a8efe9edf65 /rts
parent26ba86f73c9125c03968aec88be919bdd6a2152b (diff)
downloadhaskell-7a6577513633b943202fc82ab7aa162e1d293c0a.tar.gz
rts: Use long-path-aware stat
Previously `pathstat` relied on msvcrt's `stat` implementation, which was not long-path-aware. It should rather be defined in terms of the `stat` implementation provided by `utils/fs`. Fixes #19541.
Diffstat (limited to 'rts')
-rw-r--r--rts/PathUtils.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/rts/PathUtils.h b/rts/PathUtils.h
index b1746f8769..8a42e34b54 100644
--- a/rts/PathUtils.h
+++ b/rts/PathUtils.h
@@ -12,10 +12,13 @@
// Use wchar_t for pathnames on Windows (#5697)
#if defined(mingw32_HOST_OS)
+#include "fs_rts.h"
+
#define pathcmp wcscmp
#define pathlen wcslen
-#define pathopen __rts_fwopen
-#define pathstat _wstat
+// N.B. Use the Win32-based file routines from utils/fs.
+#define pathopen FS(fwopen)
+#define pathstat FS(_wstat)
#define struct_stat struct _stat
#define open wopen
#define WSTR(s) L##s