Update errno.

This commit is contained in:
Christoffer Lerno
2022-01-17 22:24:52 +01:00
parent 1743036104
commit f53dd95aa7
2 changed files with 3 additions and 3 deletions

View File

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

View File

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