1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-07 06:10:25 +00:00

use fileno()

Should use fileno() instead of direct
This commit is contained in:
peteee 2024-12-14 07:17:28 -05:00 committed by GitHub
parent ff173047f4
commit ed63987fd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);