keyfile: add advisory locking
commitbdd4dc68f54f9700a9b7c13cf035b0deba03612c
authorRyan Lortie <desrt@desrt.ca>
Sat, 12 Jan 2013 00:23:18 +0000 (11 19:23 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sat, 12 Jan 2013 00:23:18 +0000 (11 19:23 -0500)
treeaa17702bd17bfebc850f0b5245683f207e5f5099
parent1f97cd016106267c722be637310b3a9c774996ba
keyfile: add advisory locking

Use fcntl() on a lockfile when accessing a keyfile.

Now reading the keyfile, notifying local processes of changes in it,
applying changes from local request and rewriting it is all done under a
single acquire of the lock.  This effectively means that concurrent
changes made to the database across several machines sharing a home
directory over NFS will be seen by all machines as having occurred in
the same order (decided by who won the race to the lock).
service/dconf-keyfile-writer.c