diff options
author | Ryan Prichard <rprichard@google.com> | 2022-07-22 16:20:47 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2022-07-22 16:20:47 -0700 |
commit | b4722cc4c96e03cdad3f23b0ba558907e82d95db (patch) | |
tree | ffa032642a0390a9e729b1abe005657c70c426d2 /lldb/source/Plugins/ScriptInterpreter/Python | |
parent | 589ddd7fe8e4dcf3323dd0b8f6af3ae953ed6037 (diff) | |
download | llvm-b4722cc4c96e03cdad3f23b0ba558907e82d95db.zip llvm-b4722cc4c96e03cdad3f23b0ba558907e82d95db.tar.gz llvm-b4722cc4c96e03cdad3f23b0ba558907e82d95db.tar.bz2 |
[libc++][test] Fix infinite loop when mkstemp fails
mkstemp is guaranteed to make at least TMP_MAX attempts to create the
random file, and if it can't, it fails with EEXIST. get_temp_file_name
shouldn't call mkstemp again if it fails with anything other than
EEXIST. A single mkstemp call seems sufficient.
On Android, I've seen mkstemp fail with:
- EROFS (because cwd wasn't set to a writable filesystem)
- EACCES (because cwd pointed to a dir owned by root, but the test
program was running as the shell user instead)
Previously, get_temp_file_name would run forever in these situations.
See D4962 and "llvm-svn: 229035"
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D130214
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
0 files changed, 0 insertions, 0 deletions