Jeff King <p...@peff.net> writes: > I dunno. This seems like a lot of manual scrambling to try to overcome > unlikely errors just to make our stderr heard (and we'd still fail in > some cases). It seems like: > > if (fstat(...)) { > /* weird, fstat failed; try our best to mention it */ > error_errno("unable to fstat gc.log.lock"); > commit_lock_file(&log_lock)); > } else if (st.st_size) { > /* we have new errors to report */ > commit_lock_file(&log_lock); > } else { > /* no new errors; clean up old ones */ > unlink(git_path("gc.log")); > rollback_lock_file(&log_lock); > } > > would be sufficient.
Yeah, that should be sufficient.