Windowqs mkstemp: open() needs more permissions.

Specifically:

1. The open must be for read only or read/write - use read/write.
2. The file permission must permit read and write.
This commit is contained in:
Jim Hague 2020-12-12 21:16:46 +00:00
parent 6439b0407a
commit 42e4cfc383
1 changed files with 1 additions and 1 deletions

View File

@ -39,5 +39,5 @@ int mkstemp(char *template)
{
if (_mktemp_s(template, strlen(template) + 1) != 0)
return -1;
return open(template, _O_CREAT | _O_EXCL, _S_IWRITE);
return open(template, _O_CREAT | _O_EXCL | _O_RDWR, _S_IWRITE | _S_IREAD);
}