From f53dd95aa752ede58aa079a0098153378473ab2f Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 17 Jan 2022 22:24:52 +0100 Subject: [PATCH] Update errno. --- resources/lib/std/io.c3 | 4 ++-- resources/lib/std/libc.c3 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/std/io.c3 b/resources/lib/std/io.c3 index f69f66899..5651fad90 100644 --- a/resources/lib/std/io.c3 +++ b/resources/lib/std/io.c3 @@ -81,7 +81,7 @@ fn void! File.seek(File *file, long offset, Seek seekMode = Seek.SET) { if (libc::fseek(file.file, (SeekIndex)(offset), (int)(seekMode))) { - switch (libc::errno) + switch (libc::errno()) { case EBADF: return IoError.FILE_NOT_SEEKABLE!; case EINVAL: return IoError.FILE_INVALID_POSITION!; @@ -107,7 +107,7 @@ fn void! File.close(File *file) @inline { if (file.file && libc::fclose(file.file)) { - switch (libc::errno) + switch (libc::errno()) { case ECONNRESET: case EBADF: return IoError.FILE_NOT_VALID!; diff --git a/resources/lib/std/libc.c3 b/resources/lib/std/libc.c3 index f3cc12ecd..ae521f226 100644 --- a/resources/lib/std/libc.c3 +++ b/resources/lib/std/libc.c3 @@ -160,7 +160,7 @@ enum Errno : ErrnoType ENOTRECOVERABLE = 131, /* State not recoverable */ } -extern Errno errno; +extern fn Errno errno(void); define TerminateFunction = fn void(); define CompareFunction = fn int(void*, void*);