Bug 977803 - Release the fcntl lock during nsProfileLock::Unlock if it was acquired. r=bsmedberg
authorLuca Niccoli <lultimouomo@gmail.com>
Fri, 28 Feb 2014 09:11:38 -0500
changeset 171254 ea6bdc02e0b60388b6f992e53f105412ed539d85
parent 171253 1e7a52cc11588971ff831e15205c5772e7f0f66e
child 171255 9cb5d636acdfb61c01d5be5db6544416cc996729
push id26319
push userryanvm@gmail.com
push dateFri, 28 Feb 2014 21:03:01 +0000
treeherdermozilla-central@8abc76dedec2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs977803
milestone30.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 977803 - Release the fcntl lock during nsProfileLock::Unlock if it was acquired. r=bsmedberg
profile/dirserviceprovider/src/nsProfileLock.cpp
--- a/profile/dirserviceprovider/src/nsProfileLock.cpp
+++ b/profile/dirserviceprovider/src/nsProfileLock.cpp
@@ -629,17 +629,17 @@ nsresult nsProfileLock::Unlock(bool aFat
             // handler.  The problem is that a call to free() might be the
             // cause of this fatal signal.  If so, calling free() might cause
             // us to wait on the malloc implementation's lock.  We're already
             // holding this lock, so we'll deadlock. See bug 522332.
             if (!aFatalSignal)
                 free(mPidLockFileName);
             mPidLockFileName = nullptr;
         }
-        else if (mLockFileDesc != -1)
+        if (mLockFileDesc != -1)
         {
             close(mLockFileDesc);
             mLockFileDesc = -1;
             // Don't remove it
         }
 #endif
 
         mHaveLock = false;