From 093684df07cee69a06deed665bbb0cb3eeaf3841 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 25 Jul 2023 13:59:33 +0200 Subject: 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 --- lib/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } /** -- cgit v1.2.3