summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-07-11 18:24:42 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-07-11 18:24:42 +0000
commitb2b2956e017305410b463ee04d73aa069f1d0836 (patch)
tree33dc52107c9be6ca6dbc9b4364329a963f0039cd /src/split.c
parenta40f69da685d71f86fe4407d28db5ae9fde25ca0 (diff)
downloadcoreutils-b2b2956e017305410b463ee04d73aa069f1d0836.tar.xz
(main): Avoid setmode; use POSIX-specified routines instead.
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/split.c b/src/split.c
index a93fdffed..7c357c8ef 100644
--- a/src/split.c
+++ b/src/split.c
@@ -541,7 +541,8 @@ main (int argc, char **argv)
quote (infile));
/* Binary I/O is safer when bytecounts are used. */
- SET_BINARY (STDIN_FILENO);
+ if (O_BINARY && ! isatty (STDIN_FILENO))
+ freopen (NULL, "rb", stdin);
/* No output file is open now. */
output_desc = -1;