[Toybox] [PATCH] netstat: various fixes.

enh enh at google.com
Sat Feb 6 12:53:31 PST 2021


Avoid fgets() into toybuf other than to skip header lines, preferring
fscanf() or xgetline() instead.

Remove the early returns if we fail to skip a header line (fixes #62).

Fix `netstat -xl` which was previously broken (because only -a would
include listening sockets).

Fix a variety of formatting issues, bringing the diff between toybox
netstat and net-tools netstat down (which was what I used for testing).

Use FLAG() more consistently.
---
 toys/net/netstat.c | 143 ++++++++++++++++++++-------------------------
 1 file changed, 62 insertions(+), 81 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210206/0d3d3c91/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-netstat-various-fixes.patch
Type: text/x-patch
Size: 10823 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210206/0d3d3c91/attachment.bin>


More information about the Toybox mailing list