diff options
| author | 2023-06-19 07:14:56 -0500 | |
|---|---|---|
| committer | 2023-06-19 07:14:56 -0500 | |
| commit | 63bb93fc0788d6edc09af7549d8251ad763ec7ae (patch) | |
| tree | 7aa2b5591a36344f17a08b247f6ab861521ff63a | |
| parent | Prepare for 1.29.0 release. (diff) | |
Fix isatty code to not use functions only defined if ev is enabled.
| -rw-r--r-- | src/core/os.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/os.c b/src/core/os.c index e4ec5cd6..70f0449c 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -1437,11 +1437,11 @@ JANET_CORE_FN(os_isatty, FILE *f = (argc == 1) ? janet_getfile(argv, 0, NULL) : stdout; #ifdef JANET_WINDOWS int fd = _fileno(f); - if (fd == -1) janet_panicv(janet_ev_lasterr()); + if (fd == -1) janet_panic("not a valid stream"); return janet_wrap_boolean(_isatty(fd)); #else int fd = fileno(f); - if (fd == -1) janet_panicv(janet_ev_lasterr()); + if (fd == -1) janet_panic(strerror(errno)); return janet_wrap_boolean(isatty(fd)); #endif } |
