Re: [PATCH v3] gc: ignore old gc.log files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]