From d961ccd350b25f3b250cbc3f98dfdf57394ed83e Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 6 Jul 2022 22:19:08 -0700 Subject: [PATCH] sockstat(1): print PID adjusted to the right This allows for easy copy-and-paste of a unix(4) peer name for lookup. With current implementation it is guaranteed that a peer listed could be found in the output. Differential revision: https://reviews.freebsd.org/D35727 --- usr.bin/sockstat/sockstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index d813b3adfd42..d607e5ed2983 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -1340,7 +1340,7 @@ display(void) pos += xprintf("%.10s", getprocname(xf->xf_pid)); while (pos < 20) pos += xprintf(" "); - pos += xprintf("%lu ", (u_long)xf->xf_pid); + pos += xprintf("%5lu ", (u_long)xf->xf_pid); while (pos < 26) pos += xprintf(" "); pos += xprintf("%-3d ", xf->xf_fd);