Renamed oserrcheck to __mappederrno. Added an additional function named

__directerrno and moved both to errno.s. Changed several sources to use these
functions. Needs testing.
                         


git-svn-id: svn://svn.cc65.org/cc65/trunk@4718 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-06-10 18:10:53 +00:00
parent 5741b6e7d3
commit 131a5cad09
13 changed files with 124 additions and 108 deletions

View File

@@ -17,7 +17,7 @@
;--------------------------------------------------------------------------
; _close
.proc _close
; Check if we have a valid handle
@@ -55,20 +55,13 @@
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, returns 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 ; Sets _errno, clears _oserror, returns -1
.endproc