Give usbdump a '-u' option for unbuffered output.

This commit is contained in:
Poul-Henning Kamp 2024-10-21 11:21:05 +00:00
parent 31eec6fe1a
commit f50d2fced2
2 changed files with 8 additions and 1 deletions

View File

@ -37,6 +37,7 @@
.Op Fl i Ar ifname
.Op Fl r Ar file
.Op Fl s Ar snaplen
.Op Fl u
.Op Fl v
.Op Fl w Ar file
.Op Fl f Ar filter
@ -89,6 +90,8 @@ This option also works with the -f option.
Snapshot
.Ar snaplen
bytes from each packet.
.It Fl u
Unbuffered output.
.It Fl v
Enable debugging messages.
When defined multiple times the verbosity level increases.

View File

@ -829,7 +829,7 @@ main(int argc, char *argv[])
const char *optstring;
char *pp;
optstring = "b:d:hi:r:s:vw:f:";
optstring = "b:d:hi:r:s:uvw:f:";
while ((o = getopt(argc, argv, optstring)) != -1) {
switch (o) {
case 'b':
@ -899,6 +899,10 @@ main(int argc, char *argv[])
if (snapshot == 0)
snapshot = -1;
break;
case 'u':
setbuf(stdout, NULL);
setbuf(stderr, NULL);
break;
case 'v':
verbose++;
break;