Hello, On Fri, Apr 28, 2023 at 11:18:18AM +0000, Klemens Nanni wrote: > On Fri, Apr 28, 2023 at 12:55:37PM +0200, Alexandr Nedvedicky wrote: > > Hello, > > [ sending off-list ] > > > > up-to-date complete diff. > > Builds, boots and works faster: > > $ time jot -w 'pass proto tcp to port ' $((20 * 1000)) 1024 | pfctl > -vnf- -onone > ... > 0m02.62s real 0m00.55s user 0m02.06s system > > Before it took about 10s real time. > > OK kn, nits inline. >
will commit the whole diff. </snip> > > @@ -968,6 +953,13 @@ pfctl_show_rules(int dev, char *path, int opts, enum > > pfctl_show format, > > case PFCTL_SHOW_NOTHING: > > break; > > } > > + errno = 0; > > + } > > + > > + if (errno != 0 && errno != ENOENT) { > > I'd drop ' != 0', it is an int and almost always checked as boolean like this. > I'll keep code as-is. Just to keep both checks in consistent shape. I don't like appearance of if (errno && errno != ENOENT) I'll address all other nits pointed out by Klemens. thanks and regards sashan