From: Eric Biggers Date: Sun, 11 May 2014 05:23:27 +0000 (-0500) Subject: create_temporary_file(): use _O_SHORT_LIVED on Windows X-Git-Tag: v1.7.0~217 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=34e06fc9cab546816311404aa2e3cf680d137267 create_temporary_file(): use _O_SHORT_LIVED on Windows --- diff --git a/src/extract.c b/src/extract.c index b1f62b12..f1fcd0f8 100644 --- a/src/extract.c +++ b/src/extract.c @@ -1171,6 +1171,7 @@ create_temporary_file(struct filedes *fd_ret, tchar **name_ret) { tchar *name; int raw_fd; + int open_flags; retry: name = ttempnam(NULL, T("wimlib")); @@ -1179,7 +1180,11 @@ retry: return WIMLIB_ERR_NOMEM; } - raw_fd = topen(name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0600); + open_flags = O_WRONLY | O_CREAT | O_EXCL | O_BINARY; +#ifdef __WIN32__ + open_flags |= _O_SHORT_LIVED; +#endif + raw_fd = topen(name, open_flags, 0600); if (raw_fd < 0) { if (errno == EEXIST) {