aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2008-08-06 11:41:04 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-06 11:41:04 +0200
commitc6aecf3bee303042c654da91ea56a36766c16ebf (patch)
treeab863f320e4c16e67c92f3433536eab8625244ff /gcc
parent49f7fe608b9df9033b0c4978074d3df380a0a178 (diff)
downloadgcc-c6aecf3bee303042c654da91ea56a36766c16ebf.zip
gcc-c6aecf3bee303042c654da91ea56a36766c16ebf.tar.gz
gcc-c6aecf3bee303042c654da91ea56a36766c16ebf.tar.bz2
s-fileio.adb (Open): When file open operation fails...
2008-08-06 Thomas Quinot <quinot@adacore.com> * s-fileio.adb (Open): When file open operation fails, raise Name_Error only when the operating system reports a non-existing file or directory (ENOENT), otherwise raise Name_Error. From-SVN: r138786
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog19
-rw-r--r--gcc/ada/s-fileio.adb10
2 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 4bf72c9..468a3ef 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,24 @@
2008-08-06 Thomas Quinot <quinot@adacore.com>
+ * sem_res.adb: Minor reformatting
+
+ * s-fileio.adb (Open): When file open operation fails, raise Name_Error
+ only when the operating system reports a non-existing file or directory
+ (ENOENT), otherwise raise Name_Error.
+
+ * exp_ch11.adb: Minor reformatting
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Access_Subprogram_Declaration): If the return type is
+ incomplete, add the access_to_subprogram type to the list of private
+ dependents only if the incomplete type will be completed in the current
+ scope.
+ (Build_Discriminant_Constraints): If the type of the discriminant is
+ access_to_variable, reject a constraint that is access_to_constant.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
* g-socket-dummy.adb, g-socket-dummy.ads, g-sothco-dummy.adb,
g-sothco-dummy.ads, g-socthi-dummy.adb, g-socthi-dummy.ads,
g-sttsne-dummy.ads: New files.
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index 41419b5..79b718e 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -33,10 +33,13 @@
with Ada.Finalization; use Ada.Finalization;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
+with Interfaces.C;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.CRTL;
with System.Case_Util; use System.Case_Util;
+with System.OS_Constants;
+with System.OS_Lib;
with System.Soft_Links;
with Ada.Unchecked_Deallocation;
@@ -47,6 +50,7 @@ package body System.File_IO is
package SSL renames System.Soft_Links;
+ use type Interfaces.C.int;
use type System.CRTL.size_t;
----------------------
@@ -984,7 +988,11 @@ package body System.File_IO is
Stream := fopen (Namestr'Address, Fopstr'Address, Encoding);
if Stream = NULL_Stream then
- if not Tempfile and then file_exists (Namestr'Address) = 0 then
+ -- Raise Name_Error if trying to open a non-existent file.
+ -- Otherwise raise Use_Error. Should we raise Device_Error for
+ -- ENOSPC???
+
+ if System.OS_Lib.Errno = System.OS_Constants.ENOENT then
raise Name_Error;
else
raise Use_Error;