Page MenuHomeFreeBSD

netstat: Complete libxo transition.
AcceptedPublic

Authored by bses30074_gmail.com on Aug 11 2023, 1:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 22, 6:23 PM
Unknown Object (File)
Thu, Jul 4, 10:12 AM
Unknown Object (File)
Jun 26 2024, 7:19 PM
Unknown Object (File)
Jun 19 2024, 12:09 AM
Unknown Object (File)
Jun 4 2024, 11:46 AM
Unknown Object (File)
May 22 2024, 10:57 AM
Unknown Object (File)
Feb 29 2024, 5:19 PM
Unknown Object (File)
Feb 1 2024, 11:29 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