mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
close IOCB if open failed -- otherwise is is still marked as "in use"
This commit is contained in:
parent
feedf6690c
commit
f04dc3570c
@ -10,12 +10,12 @@
|
||||
.export __graphics
|
||||
|
||||
.import findfreeiocb
|
||||
.import __do_oserror,__oserror
|
||||
.import __oserror
|
||||
.import fddecusage
|
||||
.import clriocb
|
||||
.import fdtoiocb
|
||||
.import newfd
|
||||
.import scrdev
|
||||
.import scrdev
|
||||
.importzp tmp1,tmp2,tmp3
|
||||
|
||||
.include "atari.inc"
|
||||
@ -97,7 +97,12 @@ doopen: txa
|
||||
stx __oserror
|
||||
rts
|
||||
|
||||
cioerr: jsr fddecusage ; decrement usage counter of fd as open failed
|
||||
jmp __do_oserror
|
||||
cioerr: sty tmp3 ; remember error code
|
||||
lda #CLOSE
|
||||
sta ICCOM,x
|
||||
jsr CIOV ; close IOCB again since open failed
|
||||
jsr fddecusage ; and decrement usage counter of fd
|
||||
lda tmp3 ; put error code into A
|
||||
jmp __mappederrno
|
||||
|
||||
.endproc ; __graphics
|
||||
|
@ -140,8 +140,12 @@ finish: php
|
||||
plp
|
||||
|
||||
bpl ok
|
||||
jsr fddecusage ; decrement usage counter of fd as open failed
|
||||
tya ; put error code into A
|
||||
sty tmp3 ; remember error code
|
||||
lda #CLOSE
|
||||
sta ICCOM,x
|
||||
jsr CIOV ; close IOCB again since open failed
|
||||
jsr fddecusage ; and decrement usage counter of fd
|
||||
lda tmp3 ; put error code into A
|
||||
jmp __mappederrno
|
||||
|
||||
ok: lda tmp2 ; get fd
|
||||
|
@ -63,6 +63,9 @@
|
||||
.endproc
|
||||
|
||||
cioerr: sty __oserror
|
||||
lda #CLOSE
|
||||
sta ICCOM,x
|
||||
jsr CIOV ; close IOCB again since open failed
|
||||
jmp return0
|
||||
|
||||
.proc _readdir
|
||||
|
Loading…
x
Reference in New Issue
Block a user