Re: [PATCH] binary-io: do not treat set_binary_mode() on stdin/out/err as an error on OS/2

2019-05-29 Thread Bruno Haible
Hi Paul, > > OK, so tee.c, tr.c etc. ought to contain the equivalent of: > > > >if (! isatty (STDIN_FILENO)) > > setmode (STDIN_FILENO, O_BINARY); > >if (! isatty (STDOUT_FILENO)) > > setmode (STDOUT_FILENO, O_BINARY); This code snippet is what we would have to write in every pr

Re: [PATCH] binary-io: do not treat set_binary_mode() on stdin/out/err as an error on OS/2

2019-05-29 Thread Paul Eggert
On 5/28/19 5:47 PM, Bruno Haible wrote: OK, so tee.c, tr.c etc. ought to contain the equivalent of: if (! isatty (STDIN_FILENO)) setmode (STDIN_FILENO, O_BINARY); if (! isatty (STDOUT_FILENO)) setmode (STDOUT_FILENO, O_BINARY); That sounds overly complicated. Can't we arrange t

Re: [PATCH] binary-io: do not treat set_binary_mode() on stdin/out/err as an error on OS/2

2019-05-29 Thread KO Myung-Hun
Hi/2. It works fine here as expected. Thanks! Bruno Haible wrote: > Hi KO, > > Thanks for the answers. > >>> * What is the result of isatty(1) >>> a) for console output? >> 1 >> >>> b) for pipe output? >> 0 >> >>> c) for regular file output? >> 0 >> >>> >>> * What is the result of isatt