"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: silence harmless errors on tog exit
To:
gameoftrees@openbsd.org
Date:
Mon, 24 Oct 2022 21:56:47 +1100

Download raw body.

Thread
On 22-10-24 12:52PM, Stefan Sperling wrote:
> On Mon, Oct 24, 2022 at 09:49:23PM +1100, Mark Jamsek wrote:
> > On 22-10-24 12:33PM, Stefan Sperling wrote:
> > > Hide additional error messages which can show up if tog gets a Ctrl-C.
> > > Users don't need to be informed about these errors.
> > > 
> > > ok?
> > 
> > yes, ok
> 
> I have found some more errors we can ignore while testing with 'G' to
> load all commits and hitting Ctrl-C while loading commits.
> 
> Revised diff:

good idea! ok

> diff /home/stsp/src/got
> commit - f044c8414b8ab21062f8866d8336fa7c8bf21897
> path + /home/stsp/src/got
> blob - d78689fb84f34bff3df940c48dc3345304d01098
> file + tog/tog.c
> --- tog/tog.c
> +++ tog/tog.c
> @@ -9378,7 +9378,11 @@ main(int argc, char *argv[])
>  		free(cmd_argv);
>  	}
>  
> -	if (error && error->code != GOT_ERR_CANCELLED)
> +	if (error && error->code != GOT_ERR_CANCELLED &&
> +	    error->code != GOT_ERR_EOF &&
> +	    error->code != GOT_ERR_PRIVSEP_EXIT &&
> +	    error->code != GOT_ERR_PRIVSEP_PIPE &&
> +	    !(error->code == GOT_ERR_ERRNO && errno == EINTR))
>  		fprintf(stderr, "%s: %s\n", getprogname(), error->msg);
>  	return 0;
>  }
> 

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68