Bug 1344223 error-check mkstemp() r=froyd
authorRandell Jesup <rjesup@jesup.org>
Fri, 02 Jun 2017 15:53:40 -0400
changeset 410268 acf2c7b496d5fbe24c77069911d7097e44429cd0
parent 410267 064c3ee69168a2ca6ba6926cc9a38c6e5c686db8
child 410269 e7aacc0f1690dcfcc45f034680b8a247e5939492
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroyd
bugs1344223
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1344223 error-check mkstemp() r=froyd MozReview-Commit-ID: 1z3cQXioTXP
xpcom/build/LateWriteChecks.cpp
--- a/xpcom/build/LateWriteChecks.cpp
+++ b/xpcom/build/LateWriteChecks.cpp
@@ -153,16 +153,19 @@ LateWriteObserver::Observe(IOInterposeOb
   int fd = _open_osfhandle((intptr_t)hFile, _O_APPEND);
   if (fd == -1) {
     MOZ_CRASH("Um, how did we get here?");
   }
 
   stream = _fdopen(fd, "w");
 #else
   int fd = mkstemp(name);
+  if (fd == -1) {
+    MOZ_CRASH("mkstemp failed");
+  }
   stream = fdopen(fd, "w");
 #endif
 
   SHA1Stream sha1Stream(stream);
 
   size_t numModules = stack.GetNumModules();
   sha1Stream.Printf("%u\n", (unsigned)numModules);
   for (size_t i = 0; i < numModules; ++i) {