This patch corrects an issue whereby source files that did not have read permissions were incorrectly referred to as "not found'. Now, these different cases are explicitly identified and warned about properly. ------------ -- Source -- ------------ -- toto.c void toto(void) { } -- hello.adb with Ada.Text_IO; use Ada.Text_IO; procedure Hello is begin Put_Line ("Hello, world!"); end Hello; ---------------------------- -- Compilation and output -- ---------------------------- & chmod a-r hello.adb & gcc -c hello.adb & chmod a+r hello.adb & chmod a-r toto.c & gcc -c toto.c & chmod a+r toto.c no read access for file "hello.adb" cc1: fatal error: toto.c: Permission denied compilation terminated. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-29 Justin Squirek * ali-util.adb, comperr.adb, errout.adb, fmap.adb, fname-sf.adb, frontend.adb, lib-xref-spark_specific.adb, gnat1drv.adb, gnatls.adb, lib.adb, lib-load.adb, lib-writ.adb, prepcomp.adb, sinput-d.adb, sinput-l.adb, sprint.adb, targparm.adb: Update comparison for checking source file status and error message and/or call to Read_Source_File. * libgnat/s-os_lib.ads: Add new potential value constant for uninitialized file descriptors. * osint.adb, osint.ads (Read_Source_File): Add extra parameter to return result of IO to encompass a read access failure in addition to a file-not-found error.