Re: [PATCH v3 00/25] Lockfile correctness and refactoring

2014-04-16 Thread Michael Haggerty
On 04/15/2014 08:40 PM, Torsten Bögershausen wrote: > refs.c: > int close_ref(struct ref_lock *lock) > { > if (close_lock_file(lock->lk)) > return -1; > lock->lock_fd = -1; > return 0; > } > > When the close() fails, fd is still >= 0, even if the file is closed. >

Re: [PATCH v3 00/25] Lockfile correctness and refactoring

2014-04-15 Thread Torsten Bögershausen
refs.c: int close_ref(struct ref_lock *lock) { if (close_lock_file(lock->lk)) return -1; lock->lock_fd = -1; return 0; } When the close() fails, fd is still >= 0, even if the file is closed. Could it be written like this ? int close_ref(struct ref_lock *lo

[PATCH v3 00/25] Lockfile correctness and refactoring

2014-04-14 Thread Michael Haggerty
Round v3. Thanks to Johannes Sixt and Peff for feedback on v2. This version addresses all issues raised for v1 [1] and v2 [2]. Changes since v2: * Instead of keeping track of whether a lock_file object is active via a new bit in a flags bitmask, store it in a separate volatile sig_atomic_t