close IOCB if open failed -- otherwise is is still marked as "in use"

This commit is contained in:
Christian Groessler
2013-07-09 23:39:42 +02:00
parent 21ef04845e
commit 1bfd39ee20
3 changed files with 17 additions and 5 deletions

View File

@@ -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