From 411a5a9483143443c17286d11bde19140ea45868 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Fri, 17 Aug 2018 13:24:08 -0700 Subject: [PATCH] Don't pass mode argument to open() from _fopen(). It isn't necessary, since paravirt.c has a default if the mode isn't pushed onto the stack. --- asminc/stat.inc | 3 --- include/sys/stat.h | 2 +- libsrc/common/_fopen.s | 6 +----- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 asminc/stat.inc diff --git a/asminc/stat.inc b/asminc/stat.inc deleted file mode 100644 index d9c74aeaa..000000000 --- a/asminc/stat.inc +++ /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 diff --git a/include/sys/stat.h b/include/sys/stat.h index e49c370f9..ece324f0b 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -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 diff --git a/libsrc/common/_fopen.s b/libsrc/common/_fopen.s index 0154858dd..29f1c4cd9 100644 --- a/libsrc/common/_fopen.s +++ b/libsrc/common/_fopen.s @@ -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 -- 2.39.5