pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. @ 2022-07-28 02:30 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Thomas Munro @ 2022-07-28 02:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix get_dirent_type() for symlinks on MinGW/MSYS. On Windows with MSVC, get_dirent_type() was recently made to return DT_LNK for junction points by commit 9d3444dc, which fixed some defective dirent.c code. On Windows with Cygwin, get_dirent_type() already worked for symlinks, as it does on POSIX systems, because Cygwin has its own fake symlinks that behave like POSIX (on closer inspection, Cygwin's dirent has the BSD d_type extension but it's probably always DT_UNKNOWN, so we fall back to lstat(), which understands Cygwin symlinks with S_ISLNK()). On Windows with MinGW/MSYS, we need extra code, because the MinGW runtime has its own readdir() without d_type, and the lstat()-based fallback has no knowledge of our convention for treating junctions as symlinks. Back-patch to 14, where get_dirent_type() landed. Reported-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/b9ddf605-6b36-f90d-7c30-7b3e95c46276%40dunslane.net Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4fc6b6eefcf98f79211bb790ee890ebcb05c178d Modified Files -------------- src/common/file_utils.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. @ 2022-07-28 02:30 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Thomas Munro @ 2022-07-28 02:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix get_dirent_type() for symlinks on MinGW/MSYS. On Windows with MSVC, get_dirent_type() was recently made to return DT_LNK for junction points by commit 9d3444dc, which fixed some defective dirent.c code. On Windows with Cygwin, get_dirent_type() already worked for symlinks, as it does on POSIX systems, because Cygwin has its own fake symlinks that behave like POSIX (on closer inspection, Cygwin's dirent has the BSD d_type extension but it's probably always DT_UNKNOWN, so we fall back to lstat(), which understands Cygwin symlinks with S_ISLNK()). On Windows with MinGW/MSYS, we need extra code, because the MinGW runtime has its own readdir() without d_type, and the lstat()-based fallback has no knowledge of our convention for treating junctions as symlinks. Back-patch to 14, where get_dirent_type() landed. Reported-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/b9ddf605-6b36-f90d-7c30-7b3e95c46276%40dunslane.net Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/fc4e5af30749eadc2acf98de426fa51910f8766b Modified Files -------------- src/common/file_utils.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. @ 2022-07-28 02:31 Thomas Munro <tmunro@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Thomas Munro @ 2022-07-28 02:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix get_dirent_type() for symlinks on MinGW/MSYS. On Windows with MSVC, get_dirent_type() was recently made to return DT_LNK for junction points by commit 9d3444dc, which fixed some defective dirent.c code. On Windows with Cygwin, get_dirent_type() already worked for symlinks, as it does on POSIX systems, because Cygwin has its own fake symlinks that behave like POSIX (on closer inspection, Cygwin's dirent has the BSD d_type extension but it's probably always DT_UNKNOWN, so we fall back to lstat(), which understands Cygwin symlinks with S_ISLNK()). On Windows with MinGW/MSYS, we need extra code, because the MinGW runtime has its own readdir() without d_type, and the lstat()-based fallback has no knowledge of our convention for treating junctions as symlinks. Back-patch to 14, where get_dirent_type() landed. Reported-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/b9ddf605-6b36-f90d-7c30-7b3e95c46276%40dunslane.net Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5ad478c9d95657948fd818ac7e97a28eea3c3433 Modified Files -------------- src/common/file_utils.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-07-28 02:31 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-07-28 02:30 pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. Thomas Munro <tmunro@postgresql.org> 2022-07-28 02:30 pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. Thomas Munro <tmunro@postgresql.org> 2022-07-28 02:31 pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS. Thomas Munro <tmunro@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox