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:
parent
ff173047f4
commit
ed63987fd1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user