From bcb0d7c6c9f5577a64e5abdc3c1cedd95eeff6a3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 3 Apr 2018 21:25:04 +0200 Subject: [PATCH] [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 1d7ef5e64f4..b02551fbe76 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; }