From d602572bbec53fe9ca906029d7bac436f65d915f Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Thu, 16 Aug 2018 23:39:31 -0700 Subject: [PATCH] Fix permissions for files created by sim65. Files created by my programs running under sim65 had really weird permissions: --w-r--r-x 1 ppelleti staff 19 Aug 16 23:22 json.test.print.tmp So, for example, my program running under sim65 was not able to read the file it had just written. This is because the third argument to open (mode) was not being specified in paravirt.c, so it was just picking up random crud off the stack to use as the mode. I added a mode of 0666, and now my program runs correctly. --- src/sim65/paravirt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim65/paravirt.c b/src/sim65/paravirt.c index a13c670a2..f210efd57 100644 --- a/src/sim65/paravirt.c +++ b/src/sim65/paravirt.c @@ -209,7 +209,7 @@ static void PVOpen (CPURegs* Regs) /* Avoid gcc warning */ (void) Mode; - RetVal = open (Path, OFlag); + RetVal = open (Path, OFlag, (mode_t) 0666); SetAX (Regs, RetVal); } -- 2.39.5