From 8194408abc3e4440246f3efef0137c8b583e5081 Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 3 Jun 2010 21:22:51 +0000 Subject: [PATCH] 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 --- libsrc/common/fwrite.s | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libsrc/common/fwrite.s b/libsrc/common/fwrite.s index 586960d50..37cf81015 100644 --- a/libsrc/common/fwrite.s +++ b/libsrc/common/fwrite.s @@ -19,7 +19,7 @@ ; ------------------------------------------------------------------------ ; Code - + .proc _fwrite ; Save file and place it into ptr1 @@ -38,10 +38,10 @@ ; File not open - lda #EINVAL - jsr __seterrno -@L1: jsr incsp6 - jmp return0 +@L1: lda #EBADF + jsr __seterrno ; Returns with A = 0 + tax ; A = X = 0 + jmp incsp6 ; Check if the stream is in an error state @@ -93,8 +93,8 @@ cmp #$FF bne @L4 -; Error in write. Set the stream error flag and bail out. _oserror and/or -; errno are already set by write(). +; Error in write. Set the stream error flag and bail out. errno is already +; set by write(). lda file sta ptr1 -- 2.39.5