Skip to content

Commit 63bb93f

Browse files
committed
Fix isatty code to not use functions only defined if ev is enabled.
1 parent 5a39a04 commit 63bb93f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/os.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,11 +1437,11 @@ JANET_CORE_FN(os_isatty,
14371437
FILE *f = (argc == 1) ? janet_getfile(argv, 0, NULL) : stdout;
14381438
#ifdef JANET_WINDOWS
14391439
int fd = _fileno(f);
1440-
if (fd == -1) janet_panicv(janet_ev_lasterr());
1440+
if (fd == -1) janet_panic("not a valid stream");
14411441
return janet_wrap_boolean(_isatty(fd));
14421442
#else
14431443
int fd = fileno(f);
1444-
if (fd == -1) janet_panicv(janet_ev_lasterr());
1444+
if (fd == -1) janet_panic(strerror(errno));
14451445
return janet_wrap_boolean(isatty(fd));
14461446
#endif
14471447
}

0 commit comments

Comments
 (0)