From e549e23a87d8fc2f966aaae6dcf097bb392822c1 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Fri, 17 Aug 2018 13:39:15 -0700 Subject: [PATCH] Use non-POSIX values for S_IREAD and S_IWRITE. (As requested in the PR.) --- include/sys/stat.h | 11 +++-------- src/sim65/paravirt.c | 6 +++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/include/sys/stat.h b/include/sys/stat.h index ece324f0b..ab0640150 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -44,15 +44,10 @@ -/* These are the values for the traditional UNIX mode bits: -** 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 src/sim65/paravirt.c -*/ +/* Must match the values in src/sim65/paravirt.c */ -#define S_IREAD 0400 -#define S_IWRITE 0200 +#define S_IREAD 0x1 +#define S_IWRITE 0x2 /*****************************************************************************/ diff --git a/src/sim65/paravirt.c b/src/sim65/paravirt.c index 63ee57829..3e43f26ea 100644 --- a/src/sim65/paravirt.c +++ b/src/sim65/paravirt.c @@ -196,7 +196,7 @@ static void PVOpen (CPURegs* Regs) /* If the caller did not supply the mode argument, ** use a reasonable default. */ - Mode = 0400 | 0200; + Mode = 0x1 | 0x2; } do { @@ -230,10 +230,10 @@ static void PVOpen (CPURegs* Regs) OFlag |= O_EXCL; } - if (Mode & 0400) { + if (Mode & 0x1) { OMode |= S_IREAD; } - if (Mode & 0200) { + if (Mode & 0x2) { OMode |= S_IWRITE; } -- 2.39.5