authorgravatar for snorredc@gmail.comSnorre <snorredc@gmail.com> 2017-10-03 15:33:30+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 09:33:30-04:00
log522b431057d1e03d3068a9880745ccdfc923212e
treee0161726aa9c8fa1f58a6eb707a8933cb4365c5c
parent3af35fc1df7c06ada037cd7371c012ca145ab6e7

fix isatty for macOS and libc (#523)


2 files changed, 3 insertions(+), 3 deletions(-)

std/io.zig+2-2
......@@ -181,7 +181,7 @@ pub const OutStream = struct {
181181 pub fn isTty(self: &OutStream) -> %bool {
182182 if (is_posix) {
183183 if (builtin.link_libc) {
184 return c.isatty(self.fd) == 0;
184 return c.isatty(self.fd) != 0;
185185 } else {
186186 return system.isatty(self.fd);
187187 }
......@@ -435,7 +435,7 @@ pub const InStream = struct {
435435 pub fn isTty(self: &InStream) -> %bool {
436436 if (is_posix) {
437437 if (builtin.link_libc) {
438 return c.isatty(self.fd) == 0;
438 return c.isatty(self.fd) != 0;
439439 } else {
440440 return system.isatty(self.fd);
441441 }
std/os/darwin.zig+1-1
......@@ -125,7 +125,7 @@ pub fn exit(code: i32) -> noreturn {
125125}
126126
127127pub fn isatty(fd: i32) -> bool {
128 c.isatty(fd) == 0
128 c.isatty(fd) != 0
129129}
130130
131131pub fn fstat(fd: i32, buf: &c.stat) -> usize {