aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgfortran/ChangeLog9
-rw-r--r--libgfortran/config.h.in3
-rwxr-xr-xlibgfortran/configure2
-rw-r--r--libgfortran/configure.ac2
-rw-r--r--libgfortran/io/unix.c6
5 files changed, 20 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 3832663..709500b 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2006-09-22 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR libfortran/27964
+ * configure.ac: Check for setmode() function.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+ * io/unix.c (output_stream): Force stdout to binary mode.
+ (error_stream): Force stderr to binary mode.
+
2006-09-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29099
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index 11f8e72..444cd2b 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -492,6 +492,9 @@
/* libm includes scalbnl */
#undef HAVE_SCALBNL
+/* Define to 1 if you have the `setmode' function. */
+#undef HAVE_SETMODE
+
/* Define to 1 if you have the `signal' function. */
#undef HAVE_SIGNAL
diff --git a/libgfortran/configure b/libgfortran/configure
index 7af0b32..75872aa 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -10037,7 +10037,7 @@ fi
done
-for ac_func in wait
+for ac_func in wait setmode
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 5e8efd4..4784fa5 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -172,7 +172,7 @@ AC_CHECK_MEMBERS([struct stat.st_rdev])
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 ttyname signal alarm ctime clock access fork execl)
-AC_CHECK_FUNCS(wait)
+AC_CHECK_FUNCS(wait setmode)
# 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 560047f..57883e0 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -1289,6 +1289,9 @@ input_stream (void)
stream *
output_stream (void)
{
+#if defined(HAVE_CRLF) && defined(HAVE_SETMODE)
+ setmode (STDOUT_FILENO, O_BINARY);
+#endif
return fd_to_stream (STDOUT_FILENO, PROT_WRITE);
}
@@ -1299,6 +1302,9 @@ output_stream (void)
stream *
error_stream (void)
{
+#if defined(HAVE_CRLF) && defined(HAVE_SETMODE)
+ setmode (STDERR_FILENO, O_BINARY);
+#endif
return fd_to_stream (STDERR_FILENO, PROT_WRITE);
}