commit 691b44ac9a1339768ff0ec6a4e3adfd1f3d114bc
parent 521e3767ff942d9c2e341a58131a03d979bda149
Author: Alexey Yerin <yyp@disroot.org>
Date: Fri, 27 Aug 2021 23:34:04 +0300
unix::tty: open /dev/tty as writable
I think this would be a reasonable setting since TTYs are conceptually
terminals and you can write text to a terminal, not just read from it.
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unix/tty/+linux/open.ha b/unix/tty/+linux/open.ha
@@ -5,7 +5,7 @@ use os;
// Return either /dev/tty or stdin, whichever is accessible and is a tty.
export fn open() (*io::stream | error) = {
- match (os::open("/dev/tty")) {
+ match (os::open("/dev/tty", fs::flags::RDWR, fs::flags::CLOEXEC)) {
i: *io::stream => return i,
fs::error => void,
};