[libcxx-commits] [PATCH] D130214: [libc++][test] Fix infinite loop when mkstemp fails
Ryan Prichard via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 21 17:26:17 PDT 2022
rprichard updated this revision to Diff 446665.
rprichard added a comment.
Rebase.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130214/new/
https://reviews.llvm.org/D130214
Files:
libcxx/test/support/platform_support.h
Index: libcxx/test/support/platform_support.h
===================================================================
--- libcxx/test/support/platform_support.h
+++ libcxx/test/support/platform_support.h
@@ -75,16 +75,12 @@
abort();
}
#else
- std::string Name;
- int FD = -1;
- do {
- Name = "libcxx.XXXXXX";
- FD = mkstemp(&Name[0]);
- if (FD == -1 && errno == EINVAL) {
- perror("mkstemp");
- abort();
- }
- } while (FD == -1);
+ std::string Name = "libcxx.XXXXXX";
+ int FD = mkstemp(&Name[0]);
+ if (FD == -1) {
+ perror("mkstemp");
+ abort();
+ }
close(FD);
return Name;
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130214.446665.patch
Type: text/x-patch
Size: 693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220722/63d1a76f/attachment.bin>
More information about the libcxx-commits
mailing list