mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Fix bug with temporary files on Windows
This commit is contained in:
parent
ab9a284640
commit
6942d7b820
45 changed files with 55 additions and 58 deletions
|
@ -100,7 +100,6 @@ textwindows int GetNtOpenFlags(int flags, int mode, uint32_t *out_perm,
|
|||
if (flags & _O_SEQUENTIAL) attr |= kNtFileFlagSequentialScan;
|
||||
if (flags & _O_RANDOM) attr |= kNtFileFlagRandomAccess;
|
||||
if (flags & _O_DIRECT) attr |= kNtFileFlagNoBuffering;
|
||||
if (flags & _O_NDELAY) attr |= kNtFileFlagWriteThrough;
|
||||
|
||||
if (out_perm) *out_perm = perm;
|
||||
if (out_share) *out_share = share;
|
||||
|
|
|
@ -66,9 +66,7 @@ int mkstemp(char *template) {
|
|||
w /= 36;
|
||||
}
|
||||
e = errno;
|
||||
if ((fd = open(template,
|
||||
O_RDWR | O_CREAT | O_EXCL | (IsWindows() ? 0x00410000 : 0),
|
||||
0600)) != -1) {
|
||||
if ((fd = open(template, O_RDWR | O_CREAT | O_EXCL, 0600)) != -1) {
|
||||
return fd;
|
||||
} else if (errno == EEXIST) {
|
||||
errno = e;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue