.export _close
- .import CLOSE
.import readdiskerror, closecmdchannel
.importzp tmp2
lda #LFN_CLOSED
sta fdtab,x
- lda tmp2 ; Get the handle
+ txa ; Get handle
clc
adc #LFN_OFFS ; Make LFN from handle
jsr CLOSE
ldx unittab,y
jsr closecmdchannel ; Close the disk command channel
pla ; Get the error code from the disk
- jmp oserrcheck ; Set _oserror and _errno, returns 0/-1
+ jmp __mappederrno ; Set _oserror and _errno, return 0/-1
; Error entry: The given file descriptor is not valid or not open
invalidfd:
lda #EBADF
-
-; Error entry. Sets _errno, clears _oserror, returns -1
-
-error: jsr __seterrno ; Returns 0 in A
- sta __oserror
- lda #$FF
- tax ; Return -1
- rts
+ jmp __directerrno ; Set _errno, clear _oserror, return -1
.endproc
-
-
-
-