Re: [PATCH bpf-next v1 2/3] veristat: strerror expects positive number (errno)

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

 



On Fri, 2025-02-28 at 14:44 -0800, Andrii Nakryiko wrote:

[...]

> > diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
> > index 8bc462299290..7d13b9234d2c 100644
> > --- a/tools/testing/selftests/bpf/veristat.c
> > +++ b/tools/testing/selftests/bpf/veristat.c
> > @@ -660,7 +660,7 @@ static int append_filter_file(const char *path)
> >         f = fopen(path, "r");
> >         if (!f) {
> >                 err = -errno;
> > -               fprintf(stderr, "Failed to open filters in '%s': %s\n", path, strerror(err));
> > +               fprintf(stderr, "Failed to open filters in '%s': %s\n", path, strerror(errno));
> 
> errno is fragile, -err would be more robust, IMO

Sure, I'll send v2.

[...]






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux