Re: [hackers] [dwm][PATCH] Fix bug in die()

From: Raymond Cole <rc_AT_wolog.xyz>
Date: Sun, 27 Oct 2024 23:33:21 +0000

On 24/10/27 06:27PM, Hiltjo Posthuma wrote:
> Thanks for the patch. I agree and the common pattern is even, at the top of
> the function:
>
> int saved_errno = errno;
>
> Then use (or restore) errno.
> I notice dmenu, dwm, libsl, sbase, etc have this bug.
>
Sorry, I didn't notice vprintf could set errno as well and made an
incomplete fix. Thank you for the correction!

On 27/10/2024 07:14PM, Storkman wrote:
> What's the bugged output? Are there implementations that clobber errno
> on success? Or are there circumstances where perror succeeds after fputc
> has already failed?
>
I would say it's just perfectionism. die() is such a small and basic
function shared by many programs so perfection makes sense.
Received on Mon Oct 28 2024 - 00:33:21 CET

This archive was generated by hypermail 2.3.0 : Mon Oct 28 2024 - 02:00:40 CET