hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 9e7c0b7fc7d1920fdf1b0b425a2f9a3d26a70cca
parent 8053ab0c7325857ef689dff7865e8f77ca1ad0c2
Author: Lorenz (xha) <me@xha.li>
Date:   Fri,  1 Dec 2023 09:51:19 +0100

OpenBSD: unix::tty isatty() use fcntl(F_ISATTY)

Signed-off-by: Lorenz (xha) <me@xha.li>

Diffstat:
Munix/tty/+openbsd/isatty.ha | 8+-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/unix/tty/+openbsd/isatty.ha b/unix/tty/+openbsd/isatty.ha @@ -7,11 +7,5 @@ use os; // Returns whether the given stream is connected to a terminal. export fn isatty(fd: io::file) bool = { - let wsz = rt::winsize { ... }; - match (rt::ioctl(fd, rt::TIOCGWINSZ, &wsz: *opaque)) { - case let e: rt::errno => - return false; - case let r: int => - return r == 0; - }; + return rt::fcntl(fd, rt::F_ISATTY, 0) is int; };