mirror of
https://github.com/janet-lang/janet
synced 2025-01-08 06:30:28 +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) {
|
if (f != NULL) {
|
||||||
#ifndef JANET_WINDOWS
|
#ifndef JANET_WINDOWS
|
||||||
struct stat st;
|
struct stat st;
|
||||||
fstat(f->_fileno, &st);
|
fstat(fileno(f), &st);
|
||||||
if (S_ISDIR(st.st_mode)) {
|
if (S_ISDIR(st.st_mode)) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
janet_panicf("cannot open directory: %s", fname);
|
janet_panicf("cannot open directory: %s", fname);
|
||||||
|
Loading…
Reference in New Issue
Block a user