Skip to content

Commit f459166

Browse files
committed
fs: explicitly compare isatty() result
Reportedly, automatic conversion of the `isatty()` int result value to a bool does not work correctly on PPC. Explicitly compare the result value with `1` to infer the boolean result value. Fixes: #165 Signed-off-by: Jo-Philipp Wich <[email protected]>
1 parent 08c2ae2 commit f459166

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/fs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ uc_fs_isatty(uc_vm_t *vm, size_t nargs)
838838
if (fd == -1)
839839
err_return(errno);
840840

841-
return ucv_boolean_new(isatty(fd));
841+
return ucv_boolean_new(isatty(fd) == 1);
842842
}
843843

844844
/**

0 commit comments

Comments
 (0)