https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bcb0d7c6c9f5577a64e5a…
commit bcb0d7c6c9f5577a64e5abdc3c1cedd95eeff6a3
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Tue Apr 3 21:25:04 2018 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Dec 29 21:37:42 2018 +0100
[CABMAN] Fix a problem with creating temp files on some Windows system
---
sdk/tools/cabman/CCFDATAStorage.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sdk/tools/cabman/CCFDATAStorage.cxx b/sdk/tools/cabman/CCFDATAStorage.cxx
index 1d7ef5e64f..b02551fbe7 100644
--- a/sdk/tools/cabman/CCFDATAStorage.cxx
+++ b/sdk/tools/cabman/CCFDATAStorage.cxx
@@ -56,7 +56,12 @@ CCFDATAStorage::~CCFDATAStorage()
ULONG CCFDATAStorage::Create()
{
if ((FileHandle = tmpfile()) == NULL)
- return CAB_STATUS_CANNOT_CREATE;
+ {
+ /* Workaround for breakage on some Windows system */
+ FileHandle = fopen(tmpnam(NULL) + 1, "wb");
+ if (FileHandle == NULL)
+ return CAB_STATUS_CANNOT_CREATE;
+ }
return CAB_STATUS_SUCCESS;
}