summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
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/runtime
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/runtime')
-rw-r--r--libgfortran/runtime/error.c3
1 files changed, 2 insertions, 1 deletions
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 =