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 171509 ea6bdc02e0b60388b6f992e53f105412ed539d85
parent 171508 1e7a52cc11588971ff831e15205c5772e7f0f66e
child 171510 9cb5d636acdfb61c01d5be5db6544416cc996729
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersbsmedberg
bugs977803
milestone30.0a1
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;