[PATCH] Printf: libc independent I/O error test
Petr Vaněk
arkamar at atlas.cz
Mon Mar 6 12:14:14 CET 2023
On Mon, Mar 06, 2023 at 11:43:40AM +0100, Ondrej Zajicek wrote:
> On Sun, Mar 05, 2023 at 04:34:40PM +0100, Petr Vaněk wrote:
> > Printf test suite fails on systems with musl libc because tests for "%m"
> > and "%M" formats expect "Input/output error" message but musl returns
> > "I/O error". Proposed change compares the printf output with string
> > returned from strerror function for EIO constant.
>
> Thanks, merged. Note that the string returned by strerror() can be
> changed by subsequent calls to strerror(), including from inside
> bsprintf(), so i added string duplication call around it:
>
> - const char *io_error_str = strerror(EIO);
> + const char *io_error_str = lp_strdup(tmp_linpool, strerror(EIO));
Yes, I see, string duplication makes sense.
Thanks!
Petr
More information about the Bird-users
mailing list