| author | |
| committer | |
| log | 78ea270cc63197e4af312463d4f0c5490285d6ba |
| tree | 6ae6236e5a31b8ade8f6cfde47979c8d2ed34455 |
| parent | cffbb32d31495c83addae7ed3882dc000fb327aa |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
2 files changed, 9 insertions(+), 1 deletions(-)
lib/std/os.zig+1-1| ... | ... | @@ -3158,7 +3158,7 @@ pub fn isatty(handle: fd_t) bool { |
| 3158 | 3158 | if (builtin.os.tag == .wasi) { |
| 3159 | 3159 | var statbuf: fdstat_t = undefined; |
| 3160 | 3160 | const err = system.fd_fdstat_get(handle, &statbuf); |
| 3161 | if (err != 0) { | |
| 3161 | if (err != .SUCCESS) { | |
| 3162 | 3162 | // errno = err; |
| 3163 | 3163 | return false; |
| 3164 | 3164 | } |
lib/std/os/test.zig+8| ... | ... | @@ -1065,3 +1065,11 @@ test "timerfd" { |
| 1065 | 1065 | try os.timerfd_settime(tfd, 0, &sit, null); |
| 1066 | 1066 | try expectEqual(try os.poll(&fds, 5), 0); |
| 1067 | 1067 | } |
| 1068 | ||
| 1069 | test "isatty" { | |
| 1070 | var tmp = tmpDir(.{}); | |
| 1071 | defer tmp.cleanup(); | |
| 1072 | ||
| 1073 | var file = try tmp.dir.createFile("foo", .{}); | |
| 1074 | try expectEqual(os.isatty(file.handle), false); | |
| 1075 | } |