Re: [PATCH v5 23/35] lockfile: avoid transitory invalid states

2014-09-23 Thread Michael Haggerty
On 09/17/2014 12:45 AM, Jonathan Nieder wrote: Michael Haggerty wrote: We could probably continue to use the filename field to encode the state by being careful to write characters 1..N-1 of the filename first, and then overwrite the NUL at filename[0] with the first character of the

[PATCH v5 23/35] lockfile: avoid transitory invalid states

2014-09-16 Thread Michael Haggerty
Because remove_lock_file() can be called any time by the signal handler, it is important that any lock_file objects that are in the lock_file_list are always in a valid state. And since lock_file objects are often reused (but are never removed from lock_file_list), that means we have to be

Re: [PATCH v5 23/35] lockfile: avoid transitory invalid states

2014-09-16 Thread Jonathan Nieder
Michael Haggerty wrote: We could probably continue to use the filename field to encode the state by being careful to write characters 1..N-1 of the filename first, and then overwrite the NUL at filename[0] with the first character of the filename, but that would be awkward and error-prone.