Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: test/support/platform_support.h

Issue 1092513002: Cherrypick 229035: Fix error checking in get_temp_file_name(). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-libcxx.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/support/platform_support.h
diff --git a/test/support/platform_support.h b/test/support/platform_support.h
index 09bb29a65e4e9f9ef0f36a411417ec90afe7c0a2..f1f31339c99c6745c30bed4c80210bd927eb7f3b 100644
--- a/test/support/platform_support.h
+++ b/test/support/platform_support.h
@@ -62,10 +62,13 @@ get_temp_file_name()
std::string Name;
int FD = -1;
do {
- Name = "libcxx.XXXXXX";
- FD = mkstemp(&Name[0]);
- assert(errno != EINVAL && "Something is wrong with the mkstemp's argument");
- } while (FD == -1 || errno == EEXIST);
+ Name = "libcxx.XXXXXX";
+ FD = mkstemp(&Name[0]);
+ if (FD == -1 && errno == EINVAL) {
Roland McGrath 2015/04/15 22:35:22 This makes an assert into something not affected b
jvoung (off chromium) 2015/04/15 22:45:33 I think the way it is now without the assert is ok
+ perror("mkstemp");
+ abort();
+ }
+ } while (FD == -1);
Roland McGrath 2015/04/15 22:35:22 do ... while (FD == -1 && errno != EEXIST); seems
Sam Clegg 2015/04/15 22:40:10 Yes, we couldn't figure out why they would want a
close(FD);
return Name;
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698