am 00ed9870: Fix error checking in get_temp_file_name().
* commit '00ed9870d98b93d8a6438e5cf9058ebbe10dab01': Fix error checking in get_temp_file_name().
This commit is contained in:
@@ -69,10 +69,13 @@ get_temp_file_name()
|
|||||||
std::string Name;
|
std::string Name;
|
||||||
int FD = -1;
|
int FD = -1;
|
||||||
do {
|
do {
|
||||||
Name = "libcxx.XXXXXX";
|
Name = "libcxx.XXXXXX";
|
||||||
FD = mkstemp(&Name[0]);
|
FD = mkstemp(&Name[0]);
|
||||||
assert(errno != EINVAL && "Something is wrong with the mkstemp's argument");
|
if (FD == -1 && errno == EINVAL) {
|
||||||
} while (FD == -1 || errno == EEXIST);
|
perror("mkstemp");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
} while (FD == -1);
|
||||||
close(FD);
|
close(FD);
|
||||||
return Name;
|
return Name;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user