summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-21 22:38:56 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-21 22:38:56 +0000
commit15c68e222fab78b3228a5b79d2387817f6f2672b (patch)
treeb9f7432f86f6ad6d6d481895ae64e47a5c5919e0 /libgfortran
parenteda715e5da050c7374a8f90d36e204b6f9dbc186 (diff)
downloadgcc-15c68e222fab78b3228a5b79d2387817f6f2672b.tar.gz
2006-10-21 Steven G. Kargl <kargl@gcc.gnu.org>
* runtime/error.c: Add errno.h (generate_error): Set iostat to errno on OS error. * libgfortran.h: Set ERROR_OS to 5000 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117939 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/libgfortran.h2
-rw-r--r--libgfortran/runtime/error.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 19c2a92a3f6..a9e70825f80 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-21 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * runtime/error.c: Add errno.h
+ (generate_error): Set iostat to errno on OS error.
+ * libgfortran.h: Set ERROR_OS to 5000
+
2006-10-20 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* generated/minval_r8.c: Regenerate.
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index cdbde51f0af..e023f0ea26e 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -397,7 +397,7 @@ typedef enum
ERROR_EOR = -2,
ERROR_END = -1,
ERROR_OK = 0, /* Indicates success, must be zero. */
- ERROR_OS, /* Operating system error, more info in errno. */
+ ERROR_OS = 5000, /* Operating system error, more info in errno. */
ERROR_OPTION_CONFLICT,
ERROR_BAD_OPTION,
ERROR_MISSING_OPTION,
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c
index 9960733f16a..f8f76d3d26f 100644
--- a/libgfortran/runtime/error.c
+++ b/libgfortran/runtime/error.c
@@ -34,6 +34,7 @@ Boston, MA 02110-1301, USA. */
#include <stdarg.h>
#include <string.h>
#include <float.h>
+#include <errno.h>
#include "libgfortran.h"
#include "../io/io.h"
@@ -457,7 +458,7 @@ generate_error (st_parameter_common *cmp, int family, const char *message)
{
/* Set the error status. */
if ((cmp->flags & IOPARM_HAS_IOSTAT))
- *cmp->iostat = family;
+ *cmp->iostat = (family == ERROR_OS) ? errno : family;
if (message == NULL)
message =