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:
Dan Albert
2015-02-13 17:59:30 +00:00
committed by Android Git Automerger

View File

@@ -71,8 +71,11 @@ get_temp_file_name()
do {
Name = "libcxx.XXXXXX";
FD = mkstemp(&Name[0]);
assert(errno != EINVAL && "Something is wrong with the mkstemp's argument");
} while (FD == -1 || errno == EEXIST);
if (FD == -1 && errno == EINVAL) {
perror("mkstemp");
abort();
}
} while (FD == -1);
close(FD);
return Name;
#endif