Opened 10 years ago
Closed 10 years ago
#302 closed enhancement (wontfix)
setmode() behavior
Reported by: | KO Myung-Hun | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | libc-0.7 |
Component: | libc | Version: | 0.6.5 |
Severity: | minor | Keywords: | |
Cc: |
Description
Hi/2.
setmode() works on every file handles, unconditionally. But it would be better to set the handles to text mode if they are consoles.
And, I think, setting consoles to binary mode is meaningless.
In practice, MinGW beahves like this.
Change History (3)
comment:1 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 10 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
What I meant is simple. Check if a file handle is for a console before setting its mode. If a console, do not set to binary mode(O_BINARY). Set to O_TEXT always. That is, I want for kLIBC to include the equivalent codes to the following,
#define setmode(h, m) (setmode)(h, isatty(h) ? O_TEXT : ( m ))
comment:3 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
What on earth are you babbling about here? setmode() in trunk/libc/src/libc/io/pc_setmode.c works on individual file handles.