summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-02 20:24:49 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-02 20:24:49 +0000
commitf2c0a16db0853c1d0a9e298c141552dba95acb7c (patch)
tree61e8eb1482c52d0c9d9c31ada709617af410ff4e /libgfortran
parent4c527b3e9a31f46b2f20f24b93b7feac4c76c6d6 (diff)
downloadgcc-f2c0a16db0853c1d0a9e298c141552dba95acb7c.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/config.h.in3
-rwxr-xr-xlibgfortran/configure3
-rw-r--r--libgfortran/configure.ac2
-rw-r--r--libgfortran/io/unix.c4
5 files changed, 18 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 1dd69cb2844..a2dba91b4db 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-02 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * 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.
+
2005-09-02 Andreas Jaeger <aj@suse.de>
* libgfortran.h: Add prototype for init_compile_options.
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index c84938e0809..bc110c9fffa 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -288,6 +288,9 @@
/* libm includes truncf */
#undef HAVE_TRUNCF
+/* Define to 1 if you have the `ttyname' function. */
+#undef HAVE_TTYNAME
+
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
diff --git a/libgfortran/configure b/libgfortran/configure
index 293fe0d53ef..6b6df14c4f9 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -7409,7 +7409,8 @@ done
-for ac_func in sleep time
+
+for ac_func in sleep time ttyname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 41dc7e67b54..8968d45bf3a 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -171,7 +171,7 @@ AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
# Check for library functions.
AC_CHECK_FUNCS(getrusage times mkstemp strtof strtold snprintf ftruncate chsize)
AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
-AC_CHECK_FUNCS(sleep time)
+AC_CHECK_FUNCS(sleep time ttyname)
# Check libc for getgid, getpid, getuid
AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index a0ed7b64510..69101efff04 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
}