add a return -1 helper

This commit is contained in:
Colin Leroy-Mira
2024-01-11 18:19:13 +01:00
parent 57e65a6bf6
commit 5d49fde788
8 changed files with 28 additions and 39 deletions

View File

@@ -7,7 +7,7 @@
.export _fclose
.import _close
.import _close, ___directerrno
.importzp ptr1
.include "errno.inc"
@@ -31,10 +31,7 @@
; File is not open
lda #EINVAL
jsr ___seterrno
lda #$FF ; Return -1
tax
rts
jmp ___directerrno
; File is open. Reset the flags and close the file.
@@ -47,4 +44,3 @@
jmp _close ; Will set errno and return an error flag
.endproc