From: Patrick Pelletier Date: Fri, 17 Aug 2018 06:39:31 +0000 (-0700) Subject: Fix permissions for files created by sim65. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d602572bbec53fe9ca906029d7bac436f65d915f;p=cc65 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. --- 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); }