From: Tonu Naks <[email protected]>

gcc/ada/ChangeLog:

        * adaint.c: use the _tsopen macro when opening RO file

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/adaint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);
-- 
2.51.0

Reply via email to