1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-15 06:03:38 -04:00

Working implementation of mkstemp on Windows.

This commit is contained in:
Witold Filipczyk 2010-03-21 21:44:57 +01:00 committed by Witold Filipczyk
parent b456fba69f
commit b10144e5b4
2 changed files with 3 additions and 4 deletions

View File

@ -226,16 +226,15 @@ gettimeofday(struct timeval* p, void* tz)
int
mkstemp(char *template)
{
char tempname[MAX_PATH];
char pathname[MAX_PATH];
/* Get the directory for temp files */
GetTempPath(MAX_PATH, pathname);
/* Create a temporary file. */
GetTempFileName(pathname, template, 0, tempname);
GetTempFileName(pathname, "ABC", 0, template);
return open(tempname, O_CREAT | O_WRONLY | O_EXCL | O_BINARY);
return open(template, O_WRONLY | O_BINARY | O_EXCL);
}
int

View File

@ -274,7 +274,7 @@ secure_close(struct secure_save_info *ssi)
}
if (ssi->secure_save && ssi->file_name && ssi->tmp_file_name) {
#ifdef CONFIG_OS_OS2
#if defined(CONFIG_OS_OS2) || defined(CONFIG_OS_WIN32)
/* OS/2 needs this, however it breaks atomicity on
* UN*X. */
unlink(ssi->file_name);