diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-10-19 04:10:58 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-10-19 04:10:58 +0000 |
commit | 1f94e1d88efeb405a810a72ad61ab637becb3761 (patch) | |
tree | e8f95541146ff846daf5d9ce7654cb1a96a92a80 /libgfortran/io/unix.c | |
parent | 9a832b6f869f95dea2cc2c4840f6d66ef725d9f6 (diff) | |
download | gcc-1f94e1d88efeb405a810a72ad61ab637becb3761.zip gcc-1f94e1d88efeb405a810a72ad61ab637becb3761.tar.gz gcc-1f94e1d88efeb405a810a72ad61ab637becb3761.tar.bz2 |
re PR fortran/33795 (Environment variable GFORTRAN_UNBUFFERED_<number> not working)
2007-10-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33795
* libgfortran.h: Add unbuffered_preconnected.
* io/unix.c (output_stream): Set stream unbuffered flag if
options.unbuffered_preconnected has been set.
(error_stream): Ditto.
* runtime/environ.c (variable_table): Add to environment variable table
the entry: GFORTRAN_UNBUFFERED_PRECONNECTED.
Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org>
From-SVN: r129470
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 9b61507..93484ea 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1411,10 +1411,16 @@ input_stream (void) stream * output_stream (void) { + stream * s; + #if defined(HAVE_CRLF) && defined(HAVE_SETMODE) setmode (STDOUT_FILENO, O_BINARY); #endif - return fd_to_stream (STDOUT_FILENO, PROT_WRITE); + + s = fd_to_stream (STDOUT_FILENO, PROT_WRITE); + if (options.unbuffered_preconnected) + ((unix_stream *) s)->unbuffered = 1; + return s; } @@ -1424,10 +1430,16 @@ output_stream (void) stream * error_stream (void) { + stream * s; + #if defined(HAVE_CRLF) && defined(HAVE_SETMODE) setmode (STDERR_FILENO, O_BINARY); #endif - return fd_to_stream (STDERR_FILENO, PROT_WRITE); + + s = fd_to_stream (STDERR_FILENO, PROT_WRITE); + if (options.unbuffered_preconnected) + ((unix_stream *) s)->unbuffered = 1; + return s; } |