Re: [PATCH v5 20/35] api-lockfile: document edge cases
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Sep 23, 2014, 12:56 UTC
- Message-ID
- <54216DF9.3020307@alum.mit.edu>
- In-Reply-To
- <20140916222344.GT29050@google.com>
On 09/17/2014 12:23 AM, Jonathan Nieder wrote:
Show 15 quoted lines
> Michael Haggerty wrote: > >> * Document the behavior of commit_lock_file() when it fails, namely >> that it rolls back the lock_file object and sets errno >> appropriately. >> >> * Document the behavior of rollback_lock_file() when called for a >> lock_file object that has already been committed or rolled back, >> namely that it is a NOOP. > > I think this would be easier to read in a separate error handling > section. That way, when writing new code using the lockfile API, > I can quickly find what functions to use and quickly find out what > the error handling conventions are --- each use of the documentation > wouldn't interfere with the other.
I added a little blurb in the error handling section explaining how commit_lock_file() and close_lock_file() behave on failure, but I left the detailed information in the sections on those functions because I couldn't find a graceful way to put all of the information in the error handling sections.
If you have a concrete suggestion, as they say, "patches are welcome" :-)
Michael
-- Michael Haggerty mhagger@alum.mit.edu