sal/osl/unx/tempfile.cxx | 6 ------
1 file changed, 6 deletions(-)
New commits:
commit 37ebd3c3de4b07638f70064b5caf58419e6a0351
Author: Stephan Bergmann <[email protected]>
AuthorDate: Thu Nov 17 11:55:52 2022 +0100
Commit: Stephan Bergmann <[email protected]>
CommitDate: Fri Nov 18 17:22:49 2022 +0100
Revert "TempFile: clear handle on close"
This reverts commit 0d9613b77fc653c6144b5e4f0136c0536300c0db: As discussed
in
the comments at
<https://gerrit.libreoffice.org/c/core/+/142344/2#message-c52fe7b2037e717525e89dd20a8f320142654ae0>
"TempFile: clear handle on close", that change was intended to reset
*pHandle to
null in cases where osl_createTempFile returns an error and has already set
*pHandle. But that is obviously not what the change actually does, it
rather
sets *pHandle to null in (only some of the) cases where osl_createTempFile
returns an error and has not modified *pHandle. Given that there may
potentially be clients that rely on osl_createTempFile not modifying the
passed
in *pHandle when it returns an error, and given that the
sal/osl/unx/tempfile.cxx implementation of osl_createTempFile now
inconsistently
set *pHandle to null in only some of the cases where it returns an error
while
the sal/osl/w32/tempfile.cxx implementation of osl_createTempFile never sets
*pHandle to null when it returns an error, it appears best to just revert
that
change.
Change-Id: Ia68353d04a488b024573ad03de0c5e5bd6e2a2c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142798
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
(cherry picked from commit d6a3510ebc04dd5f24366f5b6426060cb149c3ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142800
Reviewed-by: Michael Stahl <[email protected]>
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index 3a7138b5218d..29a4d453f80c 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -330,13 +330,7 @@ oslFileError SAL_CALL osl_createTempFile(
}
if (temp_file_handle)
- {
osl_closeFile(temp_file_handle);
- if (pHandle)
- {
- *pHandle = nullptr;
- }
- }
rtl_uString_release(base_directory);