]> git.sur5r.net Git - cc65/commitdiff
Don't pass mode argument to open() from _fopen().
authorPatrick Pelletier <code@funwithsoftware.org>
Fri, 17 Aug 2018 20:24:08 +0000 (13:24 -0700)
committerOliver Schmidt <ol.sc@web.de>
Fri, 17 Aug 2018 21:28:45 +0000 (23:28 +0200)
It isn't necessary, since paravirt.c has a default if the mode isn't
pushed onto the stack.

asminc/stat.inc [deleted file]
include/sys/stat.h
libsrc/common/_fopen.s

diff --git a/asminc/stat.inc b/asminc/stat.inc
deleted file mode 100644 (file)
index d9c74ae..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-; File mode constants, must match the values in the C headers
-S_IREAD         = $0100  ; octal 0400
-S_IWRITE        = $0080  ; octal 0200
index e49c370f96c3b2634c57b8b4ab41dc765cdef159..ece324f0b71ca010acff53a39bc4de7da60e9dee 100644 (file)
@@ -48,7 +48,7 @@
 ** https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation
 ** (S_IREAD and S_IWRITE are aliases for S_IRUSR and S_IWUSR)
 **
-** Must match the values in asminc/stat.inc and src/sim65/paravirt.c
+** Must match the values in src/sim65/paravirt.c
 */
 
 #define S_IREAD  0400
index 0154858dd34180969da9d50ad2de46a72b6da1c9..29f1c4cd92165ff1de2d1d4f03a522793a3c514c 100644 (file)
@@ -15,7 +15,6 @@
         .include        "errno.inc"
         .include        "fcntl.inc"
         .include        "_file.inc"
-        .include        "stat.inc"
 
 
 ; ------------------------------------------------------------------------
@@ -83,10 +82,7 @@ modeok: ldy     #$00
         tya
         iny
         sta     (sp),y
-        lda     #<(S_IREAD|S_IWRITE)
-        ldx     #>(S_IREAD|S_IWRITE)
-        jsr     pushax          ; Push the "mode" argument onto the stack
-        ldy     #6              ; Size of arguments in bytes
+        ldy     #4              ; Size of arguments in bytes
         jsr     _open           ; Will cleanup the stack
 
 ; Check the result of the open() call