Details
- Reviewers
lwhsu des - Commits
- rG95968ea7ec8f: netstat(1): Complete libxo transition
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 53174 Build 50065: arc lint + arc unit
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 | ||
---|---|---|
119 | EX_OSERR | |
usr.bin/netstat/main.c | ||
445 | EX_OSERR | |
451 | EX_USAGE | |
460 | EX_IOERR | |
461 | EX_OK | |
921 | There is no need to call xo_finish() here. | |
923 | EX_USAGE. | |
usr.bin/netstat/netisr.c | ||
236 | EX_OSERR | |
usr.bin/netstat/nhgrp.c | ||
216 | EX_OSERR | |
218 | EX_OSERR | |
usr.bin/netstat/nhops.c | ||
219 | EX_OSERR | |
361 | EX_OSERR | |
363 | EX_OSERR | |
usr.bin/netstat/route_netlink.c | ||
109 | EX_OSERR |
usr.bin/netstat/main.c | ||
---|---|---|
901 | There is no need for a cast as xo_error() does not return anything. |
usr.bin/netstat/main.c | ||
---|---|---|
445 | 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 | ||
---|---|---|
599 | 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. |