Fixed errno handling
git-svn-id: svn://svn.cc65.org/cc65/trunk@120 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
.export _atexit, doatexit
|
.export _atexit, doatexit
|
||||||
.import __errno, jmpvec
|
.import __errno, jmpvec
|
||||||
|
|
||||||
|
.include "errno.inc"
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
ecount: .byte 0 ; Really an index, inc'ed by 2
|
ecount: .byte 0 ; Really an index, inc'ed by 2
|
||||||
efunc: .word 0,0,0,0,0 ; 5 exit functions
|
efunc: .word 0,0,0,0,0 ; 5 exit functions
|
||||||
@@ -39,10 +41,12 @@ _atexit:
|
|||||||
|
|
||||||
; Error, no space left
|
; Error, no space left
|
||||||
|
|
||||||
E0: lda #$FF
|
E0: lda #ENOSPC ; No space left
|
||||||
sta __errno ; Use -1 until codes are defined ###
|
sta __errno
|
||||||
sta __errno+1
|
ldx #$00
|
||||||
tax
|
stx __errno+1
|
||||||
|
dex
|
||||||
|
txa
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Function called from exit
|
; Function called from exit
|
||||||
|
|||||||
Reference in New Issue
Block a user