summaryrefslogtreecommitdiffhomepage
path: root/lib/fs.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-07-25 13:59:33 +0200
committerJo-Philipp Wich <jo@mein.io>2023-07-25 14:06:23 +0200
commit093684df07cee69a06deed665bbb0cb3eeaf3841 (patch)
tree245da48303925ba3d5215f574344ee2b16904ee4 /lib/fs.c
parent4f4f38f4f5d09cd5f5f1d036db841fb23d69e59d (diff)
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 <jo@mein.io>
Diffstat (limited to 'lib/fs.c')
-rw-r--r--lib/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fs.c b/lib/fs.c
index 5266ce9..e00f7fa 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -838,7 +838,7 @@ uc_fs_isatty(uc_vm_t *vm, size_t nargs)
if (fd == -1)
err_return(errno);
- return ucv_boolean_new(isatty(fd));
+ return ucv_boolean_new(isatty(fd) == 1);
}
/**