aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-09-02 22:24:49 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2005-09-02 20:24:49 +0000
commit8845001b6c4505809a171c3f37790efd1335e7f7 (patch)
tree61e8eb1482c52d0c9d9c31ada709617af410ff4e /libgfortran/io/unix.c
parentb107d7437b09d209d217b102c40ca45f81bc844b (diff)
downloadgcc-8845001b6c4505809a171c3f37790efd1335e7f7.zip
gcc-8845001b6c4505809a171c3f37790efd1335e7f7.tar.gz
gcc-8845001b6c4505809a171c3f37790efd1335e7f7.tar.bz2
unix.c (stream_ttyname): Protect use of ttyname by HAVE_TTYNAME macro.
* io/unix.c (stream_ttyname): Protect use of ttyname by HAVE_TTYNAME macro. * configure.ac: Add check for ttyname. * config.h.in: Regenerate. * configure: Regenerate. From-SVN: r103794
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index a0ed7b6..69101ef 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -1548,7 +1548,11 @@ stream_isatty (stream *s)
char *
stream_ttyname (stream *s)
{
+#ifdef HAVE_TTYNAME
return ttyname (((unix_stream *) s)->fd);
+#else
+ return NULL;
+#endif
}