Stefan Beller <stefanbeller@xxxxxxxxx> writes: > Sounds reasonable. Though by closing the file we're giving up again a > bit of safety. If we close the file everyone could tamper with the lock > file. (Sure they are not supposed to touch it, but they could) There are locking primitives (SysV mandatory locking) that require you to keep the file you have lock on open for you to retain the ownership of the lock, and that kind of lock does prevent random other processes from simultaneously accessing the locked file. But that is not what our locks are designed around; our locks rely only on "open(O_EXCL|O_CREAT) fails if it already exists". And between keeping a lockfile open and closing but not removing a lockfile, there is no difference how the lockfile that still exists prevents open(O_EXCL|O_CREAT) by other processes from succeeding. So we are not giving up any safety at all, which is a good thing ;-). -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html