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.
>
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
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
3 matches
Mail list logo