Re: [PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-10 Thread Duy Nguyen
On Wed, Sep 10, 2014 at 2:55 PM, Jeff King wrote: > BTW, while grepping for commit_lock_file calls, I notice we often commit > the shallow file without checking the return code. I'm not sure what we > should do in each case, but I imagine that calling die() is probably > better than continuing as

Re: [PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-10 Thread Jeff King
On Sat, Sep 06, 2014 at 09:50:33AM +0200, Michael Haggerty wrote: > If rename() fails, call rollback_lock_file() to delete the lock file > (in case it is still present) and reset the filename field to the > empty string so that the lockfile object is left in a valid state. Unlike the previous pat

[PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-06 Thread Michael Haggerty
If rename() fails, call rollback_lock_file() to delete the lock file (in case it is still present) and reset the filename field to the empty string so that the lockfile object is left in a valid state. Signed-off-by: Michael Haggerty --- lockfile.c | 18 +++--- 1 file changed, 11 ins