1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +00:00

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.
This commit is contained in:
Patrick Pelletier 2018-08-16 23:39:31 -07:00 committed by Oliver Schmidt
parent d13d068e71
commit d602572bbe

View File

@ -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);
}