diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h index 7429b03f4eea..a6fa5661dfbf 100644 --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -75,16 +75,12 @@ std::string get_temp_file_name() 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