Closed Bug 977803 Opened 6 years ago Closed 6 years ago

nsProfileLock::Unlock is brocken on unix

Categories

(Toolkit :: Startup and Profile System, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: lultimouomo, Assigned: lultimouomo)

References

Details

Attachments

(1 file)

Calling nsProfileLock::Unlock on a directory that has been locked with nsProfileLock::LockWithFcntl does not cause the fcntl lock to be released.
Only terminating the application releases the lock.

This is because nsProfileLock::Lock calls both LockWithFcntl and LockWithSynlink (http://mxr.mozilla.org/mozilla-central/source/profile/dirserviceprovider/src/nsProfileLock.cpp#535); then nsProfileLock::Unlock does not release the fcntl lock if it finds the symlink (http://mxr.mozilla.org/mozilla-central/source/profile/dirserviceprovider/src/nsProfileLock.cpp#623)
This patch makes sure that the fcntl lock is released if it had been acquired.
Attachment #8383254 - Flags: review?(benjamin)
Blocks: 921063
Comment on attachment 8383254 [details] [diff] [review]
mutexunlock.patch

Indeed!
Attachment #8383254 - Flags: review?(benjamin) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/ea6bdc02e0b6
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.