Bug 407537 - Dont normalize a nonexistant file r=biesi
authorsayre@gmail.com
Wed, 03 Feb 2016 13:47:20 -0500
changeset 282902 a8a6133b6eebcc6fb7216ef75d8726eecfc65e29
parent 282901 d4fe24eab2b74d044332321e23ba55dab8fdc687
child 282903 9c4d77b43082b668b2c437917707264bea86a2e8
push id71351
push usermcmanus@ducksong.com
push dateWed, 03 Feb 2016 19:07:54 +0000
treeherdermozilla-inbound@a8a6133b6eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbiesi
bugs407537
milestone47.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 407537 - Dont normalize a nonexistant file r=biesi
netwerk/base/nsFileStreams.cpp
--- a/netwerk/base/nsFileStreams.cpp
+++ b/netwerk/base/nsFileStreams.cpp
@@ -924,17 +924,19 @@ nsAtomicFileOutputStream::DoOpen()
     // 2) to make the MoveToNative() in Finish() an atomic operation (which may not
     //    be the case if moving across directories on different filesystems).
     nsCOMPtr<nsIFile> tempResult;
     rv = file->Clone(getter_AddRefs(tempResult));
     if (NS_SUCCEEDED(rv)) {
         tempResult->SetFollowLinks(true);
 
         // XP_UNIX ignores SetFollowLinks(), so we have to normalize.
-        tempResult->Normalize();
+        if (mTargetFileExists) {
+            tempResult->Normalize();
+        }
     }
 
     if (NS_SUCCEEDED(rv) && mTargetFileExists) {
         uint32_t origPerm;
         if (NS_FAILED(file->GetPermissions(&origPerm))) {
             NS_ERROR("Can't get permissions of target file");
             origPerm = mOpenParams.perm;
         }