From: Tonu Naks Date: Wed, 19 Nov 2025 12:56:55 +0000 (+0000) Subject: ada: Ensure that file is not locked on windows when opened RO X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58ccdca74a4d0e6b2087df211aedc5747edc65c3;p=thirdparty%2Fgcc.git ada: Ensure that file is not locked on windows when opened RO gcc/ada/ChangeLog: * adaint.c: use the _tsopen macro when opening RO file --- diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index adc39517280..1b99312630c 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -179,6 +179,7 @@ extern "C" { #elif defined (__MINGW32__) || defined (__CYGWIN__) #include "mingw32.h" +#include "share.h" /* Current code page and CCS encoding to use, set in rtinit.c. */ UINT __gnat_current_codepage; @@ -940,7 +941,7 @@ __gnat_open_read (char *path, int fmode) TCHAR wpath[GNAT_MAX_PATH_LEN]; S2WSC (wpath, path, GNAT_MAX_PATH_LEN); - fd = _topen (wpath, O_RDONLY | o_fmode, 0444); + fd = _tsopen (wpath, O_RDONLY | o_fmode, _SH_DENYNO, 0444); } #else fd = GNAT_OPEN (path, O_RDONLY | o_fmode);