diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-07-25 13:59:33 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-07-25 14:06:23 +0200 |
commit | 093684df07cee69a06deed665bbb0cb3eeaf3841 (patch) | |
tree | 245da48303925ba3d5215f574344ee2b16904ee4 /lib/fs.c | |
parent | 4f4f38f4f5d09cd5f5f1d036db841fb23d69e59d (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } /** |