Bug 477934 nsSafeFileOutputStream (prefs.js) not safe from system crashes
authortimeless@mozdev.org
Thu, 12 Mar 2009 13:13:00 +0100
changeset 27856 3f38a00b89cd014796b4241a53f1aeefdeb375e9
parent 27855 857aabc781ccd83610c340555bd002afba27b327
child 27857 2889ce731c68ca02fe5b4bd491596ce88d67ec20
push idunknown
push userunknown
push dateunknown
bugs477934
milestone1.9.2a1pre
Bug 477934 nsSafeFileOutputStream (prefs.js) not safe from system crashes r=biesi
netwerk/base/src/nsFileStreams.cpp
--- a/netwerk/base/src/nsFileStreams.cpp
+++ b/netwerk/base/src/nsFileStreams.cpp
@@ -526,16 +526,17 @@ nsSafeFileOutputStream::Close()
     }
 
     return rv;
 }
 
 NS_IMETHODIMP
 nsSafeFileOutputStream::Finish()
 {
+    Flush();
     nsresult rv = nsFileOutputStream::Close();
 
     // if there is no temp file, don't try to move it over the original target.
     // It would destroy the targetfile if close() is called twice.
     if (!mTempFile)
         return rv;
 
     // Only overwrite if everything was ok, and the temp file could be closed.