From ed63987fd1b52a1d283bdbdd80407e3f4f2e0671 Mon Sep 17 00:00:00 2001 From: peteee Date: Sat, 14 Dec 2024 07:17:28 -0500 Subject: [PATCH] use fileno() Should use fileno() instead of direct --- src/core/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/io.c b/src/core/io.c index 2b8e06af..0f6703e9 100644 --- a/src/core/io.c +++ b/src/core/io.c @@ -167,7 +167,7 @@ JANET_CORE_FN(cfun_io_fopen, if (f != NULL) { #ifndef JANET_WINDOWS struct stat st; - fstat(f->_fileno, &st); + fstat(fileno(f), &st); if (S_ISDIR(st.st_mode)) { fclose(f); janet_panicf("cannot open directory: %s", fname);