[PATCH 2 of 3] chg: add util function abortmsge to print error with errno

Jun Wu quark at fb.com
Tue Apr 5 11:53:15 EDT 2016


On 04/05/2016 04:33 PM, Danek Duvall wrote:
> At least vfprintf() can fail, setting errno; I'm pretty sure fputs() can,
> too.  I don't know about fsetcolor(), but I'd suspect so.
>
> So you probably need to preserve errno first thing coming in to the
> function, and then check that, or errno might not be what you think it is.
> Either that, or pass it in as the first argument, but that'll take more
> restructuring of the code.
>
> Danek

Thanks! I should be more careful.


More information about the Mercurial-devel mailing list