From: Duy Nguyen Date: Wed, 10 Sep 2014 12:55:07 GMT Subject: Re: [PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename Message-ID: In-Reply-To: <20140910075519.GA16413@peff.net> 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 if it succeeded. +cc Duy Noted. To be fixed soon. It looks like we could make gcc warn about ignoring return code like this with __attribute__((warn_unused_result)) (but I haven't tested). If it does help catch mishandling in future commit_lock_file calls and does not upset other compilers, we may want to add it to commit_lock_file. -- Duy