Page MenuHomeFreeBSD

netstat: Complete libxo transition.
AcceptedPublic

Authored by bses30074_gmail.com on Aug 11 2023, 1:30 PM.
Tags
None
Referenced Files
F93198985: D41427.id126227.diff
Sun, Sep 8, 2:01 AM
F93149296: D41427.id126248.diff
Sat, Sep 7, 4:17 PM
F93135191: D41427.id125878.diff
Sat, Sep 7, 1:21 PM
F93126747: D41427.id126227.diff
Sat, Sep 7, 11:58 AM
Unknown Object (File)
Sat, Sep 7, 12:39 AM
Unknown Object (File)
Wed, Aug 21, 5:11 PM
Unknown Object (File)
Wed, Aug 21, 12:33 AM
Unknown Object (File)
Sun, Aug 18, 8:59 AM

Details

Reviewers
lwhsu
des

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 53182
Build 50073: 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
446

EX_OSERR

452

EX_USAGE

459

EX_IOERR

460

EX_OK

921

There is no need to call xo_finish() here.

923

EX_USAGE.

usr.bin/netstat/netisr.c
237

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

des requested changes to this revision.Aug 17 2023, 3:58 PM
This revision now requires changes to proceed.Aug 17 2023, 3:58 PM
usr.bin/netstat/main.c
902

There is no need for a cast as xo_error() does not return anything.

usr.bin/netstat/main.c
446

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
  • Use EX_ string from sysexits.h if the file include it.
des requested changes to this revision.Aug 19 2023, 1:38 PM

Please don't mix and match. Pick a style and stick to it throughout the program.

This revision now requires changes to proceed.Aug 19 2023, 1:38 PM
  • Using sysexits.h string in all the files.

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
598

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.

This revision is now accepted and ready to land.Aug 26 2023, 11:59 PM