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.
From-SVN: r71628
+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.
{
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 */
#include "config.h"
#endif
#include "f2c.h"
+#include "fio.h"
#include <sys/types.h>
#include <sys/stat.h>
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;
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