diff options
author | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-21 16:16:46 +0000 |
---|---|---|
committer | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-21 16:16:46 +0000 |
commit | c13415b17b206df78e520439cda59439e9e44dae (patch) | |
tree | 254e8d1bd815a14e9ce057b077058c4462f48580 /libf2c | |
parent | 14504ce202a761138d74718001f95daddb4c9a9f (diff) | |
download | gcc-c13415b17b206df78e520439cda59439e9e44dae.tar.gz |
2003-09-21 Toon Moene <toon@moene.indiv.nluug.nl>
PR libf2c/11918
* fstat_.c: Call f_init().
* isatty_.c: Ditto.
* fnum_.c: Check file descriptor before handing it back.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71628 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libf2c')
-rw-r--r-- | libf2c/ChangeLog | 7 | ||||
-rw-r--r-- | libf2c/libU77/fnum_.c | 4 | ||||
-rw-r--r-- | libf2c/libU77/fstat_.c | 2 | ||||
-rw-r--r-- | libf2c/libU77/isatty_.c | 1 |
4 files changed, 14 insertions, 0 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog index 32647c6c735..78fc92cadd2 100644 --- a/libf2c/ChangeLog +++ b/libf2c/ChangeLog @@ -1,3 +1,10 @@ +2003-09-21 Toon Moene <toon@moene.indiv.nluug.nl> + + PR libf2c/11918 + * fstat_.c: Call f_init(). + * isatty_.c: Ditto. + * fnum_.c: Check file descriptor before handing it back. + Tue Sep 9 15:22:57 2003 Alan Modra <amodra@bigpond.net.au> * configure: Regenerate. diff --git a/libf2c/libU77/fnum_.c b/libf2c/libU77/fnum_.c index daf8f3dc080..27cadec287a 100644 --- a/libf2c/libU77/fnum_.c +++ b/libf2c/libU77/fnum_.c @@ -27,6 +27,10 @@ G77_fnum_0 (integer * lunit) { if (*lunit >= MXUNIT || *lunit < 0) err (1, 101, "fnum"); + + if (f__units[*lunit].ufd == NULL) + err (1, 114, "fnum"); + /* f__units is a table of descriptions for the unit numbers (defined in io.h). Use file descriptor (ufd) and fileno rather than udev field since udev is unix specific */ diff --git a/libf2c/libU77/fstat_.c b/libf2c/libU77/fstat_.c index e978c6adb2e..7fd439c2a40 100644 --- a/libf2c/libU77/fstat_.c +++ b/libf2c/libU77/fstat_.c @@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #endif #include "f2c.h" +#include "fio.h" #include <sys/types.h> #include <sys/stat.h> @@ -34,6 +35,7 @@ G77_fstat_0 (const integer * lunit, integer statb[13]) int err; struct stat buf; + if (f__init != 1) f_init(); err = fstat (G77_fnum_0 (lunit), &buf); statb[0] = buf.st_dev; statb[1] = buf.st_ino; diff --git a/libf2c/libU77/isatty_.c b/libf2c/libU77/isatty_.c index fa2f56dafab..a781f757bc5 100644 --- a/libf2c/libU77/isatty_.c +++ b/libf2c/libU77/isatty_.c @@ -30,6 +30,7 @@ extern integer G77_fnum_0 (integer *); logical G77_isatty_0 (integer * lunit) { + if (f__init != 1) f_init(); if (*lunit >= MXUNIT || *lunit < 0) err (1, 101, "isatty"); /* f__units is a table of descriptions for the unit numbers (defined |