Re: [GSoC][PATCH v15 5/9] fsck: add refs report function

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

 



On Tue, Aug 06, 2024 at 12:45:57AM +0800, shejialuo wrote:
> @@ -1237,6 +1250,34 @@ int fsck_objects_error_function(struct fsck_options *o,
>  	return 1;
>  }
>  
> +int fsck_refs_error_function(struct fsck_options *options UNUSED,
> +			     void *fsck_report,
> +			     enum fsck_msg_type msg_type,
> +			     enum fsck_msg_id msg_id UNUSED,
> +			     const char *message)
> +{
> +	struct fsck_ref_report *report = fsck_report;
> +

Nit: there's an unneeded empty newline here.

> +	struct strbuf sb = STRBUF_INIT;
> +	int ret = 0;
> +
> +	strbuf_addstr(&sb, report->path);
> +
> +	if (report->oid)
> +		strbuf_addf(&sb, " -> (%s)", oid_to_hex(report->oid));
> +	else if (report->referent)
> +		strbuf_addf(&sb, " -> (%s)", report->referent);
> +
> +	if (msg_type == FSCK_WARN)
> +		warning("%s: %s", sb.buf, message);
> +	else
> +		ret = error("%s: %s", sb.buf, message);
> +
> +	strbuf_release(&sb);
> +	return ret;
> +

Here, as well.

Patrick

Attachment: signature.asc
Description: PGP signature


[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]

  Powered by Linux