error.c: Add errno.h

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

From-SVN: r117939
This commit is contained in:
Steven G. Kargl 2006-10-21 22:38:56 +00:00
parent 96208aed83
commit 4a8bce89d1
3 changed files with 9 additions and 2 deletions

View File

@ -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.

View File

@ -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,

View File

@ -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 =