Details
- Reviewers
lwhsu des - Commits
- rG95968ea7ec8f: netstat(1): Complete libxo transition
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
This program uses sysexits(3), but not consistently. This should be fixed. I've highlighted some of the required changes.
usr.bin/netstat/common.c | ||
---|---|---|
116 | EX_OSERR | |
usr.bin/netstat/main.c | ||
464 | EX_OSERR | |
470 | EX_USAGE | |
477 | EX_IOERR | |
478 | EX_OK | |
946 | There is no need to call xo_finish() here. | |
948 | EX_USAGE. | |
usr.bin/netstat/netisr.c | ||
234 | EX_OSERR | |
usr.bin/netstat/nhgrp.c | ||
214 | EX_OSERR | |
216 | EX_OSERR | |
usr.bin/netstat/nhops.c | ||
215 | EX_OSERR | |
357 | EX_OSERR | |
359 | EX_OSERR | |
usr.bin/netstat/route_netlink.c | ||
106 | EX_OSERR |
usr.bin/netstat/main.c | ||
---|---|---|
927 | There is no need for a cast as xo_error() does not return anything. |
usr.bin/netstat/main.c | ||
---|---|---|
464 | main.c doesn't include sysexits.h. And most of the codes use the number instead of EXIT_ string. I may use the number style here to avoid too much change. |
In some files sysexit.h is not include (below lists), I use the number style there to avoid much change.
a. main.c b. netisr.c
The above has sysexit.h use EX_ string.
a. common.c b. if.c c. nhgrp.c d. nhops.c e. route.c f. route_netlink.c f. route_netlink.c
Thank you for going the extra mile. Remember to mark my comments as done next time :) You may have to press “Submit” twice, because Phabricator is kinda dumb.
usr.bin/netstat/main.c | ||
---|---|---|
623–625 | If you want, you can add a label here and replace every earlier occurrence of this and the next two lines with a goto to that label. But it's also fine as-is. |