Re: bgpd kroute includes cleanup
On Wed, Aug 17, 2022 at 02:48:42PM +0200, Theo Buehler wrote: > On Wed, Aug 17, 2022 at 02:25:51PM +0200, Claudio Jeker wrote: > > Remove some unneeded headers from kroute.c > > Also move sys/tree.h up above the other sys includes. > > err.h was never used, fcntl.h was used for a bit more than two days > after import, so these can definitely go. > > arpa/inet.h is used for ntohl() and friends, or do you want to rely on > bgpd.h to pull this in? It is also defined by netinet/in.h but that is less portable. I add it back. > More things to clean up if you want: > > kroute.c also needs sys/queue.h and imsg.h, which it gets via bgpd.h. > Plus strings.h (bcopy, ffs) is pulled in via string.h. Arrg, strings.h vs string.h. I thought just use string.h but it can never be that simple. On a rampage now to convert all the bcmp, bcopy and bzero to memcmp, memcpy and memset. After that we have ffs which still needs strings.h. Why posix, why? > style(9) wants an empty line before errno.h. Added. -- :wq Claudio
Re: bgpd kroute includes cleanup
On Wed, Aug 17, 2022 at 02:25:51PM +0200, Claudio Jeker wrote: > Remove some unneeded headers from kroute.c > Also move sys/tree.h up above the other sys includes. err.h was never used, fcntl.h was used for a bit more than two days after import, so these can definitely go. arpa/inet.h is used for ntohl() and friends, or do you want to rely on bgpd.h to pull this in? More things to clean up if you want: kroute.c also needs sys/queue.h and imsg.h, which it gets via bgpd.h. Plus strings.h (bcopy, ffs) is pulled in via string.h. style(9) wants an empty line before errno.h.
bgpd kroute includes cleanup
Remove some unneeded headers from kroute.c Also move sys/tree.h up above the other sys includes. -- :wq Claudio Index: kroute.c === RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v retrieving revision 1.291 diff -u -p -r1.291 kroute.c --- kroute.c17 Aug 2022 10:54:52 - 1.291 +++ kroute.c17 Aug 2022 10:59:55 - @@ -18,22 +18,19 @@ */ #include +#include #include #include #include -#include #include #include -#include #include #include #include #include #include #include -#include #include -#include #include #include #include