| author | |
| committer | |
| log | 6f39ce93ce358743df0abe1acdac75f3fd6a2eab |
| tree | 308a68808c49f0001604602dd0aa868b7d259d14 |
| parent | 07f6fc30002b479d711a3a990dab75686cf14bec |
2 files changed, 9 insertions(+), 1 deletions(-)
lib/std/os.zig+1-1| ... | @@ -3290,7 +3290,7 @@ pub fn isatty(handle: fd_t) bool { | ... | @@ -3290,7 +3290,7 @@ pub fn isatty(handle: fd_t) bool { |
| 3290 | if (builtin.os.tag == .wasi) { | 3290 | if (builtin.os.tag == .wasi) { |
| 3291 | var statbuf: fdstat_t = undefined; | 3291 | var statbuf: fdstat_t = undefined; |
| 3292 | const err = system.fd_fdstat_get(handle, &statbuf); | 3292 | const err = system.fd_fdstat_get(handle, &statbuf); |
| 3293 | if (err != 0) { | 3293 | if (err != .SUCCESS) { |
| 3294 | // errno = err; | 3294 | // errno = err; |
| 3295 | return false; | 3295 | return false; |
| 3296 | } | 3296 | } |
lib/std/os/test.zig+8| ... | @@ -1077,3 +1077,11 @@ test "timerfd" { | ... | @@ -1077,3 +1077,11 @@ test "timerfd" { |
| 1077 | try os.timerfd_settime(tfd, 0, &sit, null); | 1077 | try os.timerfd_settime(tfd, 0, &sit, null); |
| 1078 | try expectEqual(try os.poll(&fds, 5), 0); | 1078 | try expectEqual(try os.poll(&fds, 5), 0); |
| 1079 | } | 1079 | } |
| 1080 | |||
| 1081 | test "isatty" { | ||
| 1082 | var tmp = tmpDir(.{}); | ||
| 1083 | defer tmp.cleanup(); | ||
| 1084 | |||
| 1085 | var file = try tmp.dir.createFile("foo", .{}); | ||
| 1086 | try expectEqual(os.isatty(file.handle), false); | ||
| 1087 | } |