mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 06:12:27 +00:00
Fix the build
This commit is contained in:
parent
6942d7b820
commit
b40d41085d
4 changed files with 32 additions and 26 deletions
|
@ -27,6 +27,8 @@
|
|||
|
||||
#define _O_TMPFILE 000020200000
|
||||
|
||||
int _mkstemp(char *, int);
|
||||
|
||||
/**
|
||||
* Returns file descriptor of open anonymous file, e.g.
|
||||
*
|
||||
|
@ -88,7 +90,7 @@ int tmpfd(void) {
|
|||
if (!(prog = program_invocation_short_name)) prog = "tmp";
|
||||
strlcat(path, prog, sizeof(path));
|
||||
strlcat(path, ".XXXXXX", sizeof(path));
|
||||
if ((fd = mkstemp(path)) == -1) return -1;
|
||||
if ((fd = _mkstemp(path, IsWindows() ? 0x00410000 : 0)) == -1) return -1;
|
||||
if (!IsWindows()) unassert(!unlink(path));
|
||||
return fd;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue