1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-08 06:25:17 +00:00

Set errno if the stream is in error state. Small code size improvements. Fixed

comment regarding _oserror.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4699 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-06-03 21:22:51 +00:00
parent b97986b124
commit 8194408abc

View File

@@ -19,7 +19,7 @@
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
; Code ; Code
.proc _fwrite .proc _fwrite
; Save file and place it into ptr1 ; Save file and place it into ptr1
@@ -38,10 +38,10 @@
; File not open ; File not open
lda #EINVAL @L1: lda #EBADF
jsr __seterrno jsr __seterrno ; Returns with A = 0
@L1: jsr incsp6 tax ; A = X = 0
jmp return0 jmp incsp6
; Check if the stream is in an error state ; Check if the stream is in an error state
@@ -93,8 +93,8 @@
cmp #$FF cmp #$FF
bne @L4 bne @L4
; Error in write. Set the stream error flag and bail out. _oserror and/or ; Error in write. Set the stream error flag and bail out. errno is already
; errno are already set by write(). ; set by write().
lda file lda file
sta ptr1 sta ptr1