Fixed sources to use the new __mappederrno and __directerrno functions, and

made handling of _oserror and errno consistent.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4731 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-06-26 11:28:44 +00:00
parent 672cffa1d2
commit ae98a6db40
4 changed files with 44 additions and 55 deletions

View File

@@ -17,7 +17,7 @@
;--------------------------------------------------------------------------
; _close
.proc _close
; Check if we have a valid handle
@@ -55,13 +55,13 @@
ldx unittab,y
jsr closecmdchannel ; Close the disk command channel
pla ; Get the error code from the disk
jmp __mappederrno ; 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
jmp __directerrno ; Sets _errno, clears _oserror, returns -1
jmp __directerrno ; Set _errno, clear _oserror, return -1
.endproc