diff options
author | 1997-06-29 21:46:00 +0000 | |
---|---|---|
committer | 1997-06-29 21:46:00 +0000 | |
commit | 0411ea35b5af79e53fa5dd216b831db96e6074af (patch) | |
tree | d98e0a14a0a4cfd269fbce77b6fa128f636659e2 /usr.bin/netstat/unix.c | |
parent | Make fields line up nicely for 64-bit addresses. Should probably #if (diff) | |
download | wireguard-openbsd-0411ea35b5af79e53fa5dd216b831db96e6074af.tar.xz wireguard-openbsd-0411ea35b5af79e53fa5dd216b831db96e6074af.zip |
Use correct spacing on both 32bit and 64bit machines.
Diffstat (limited to 'usr.bin/netstat/unix.c')
-rw-r--r-- | usr.bin/netstat/unix.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c index b097c38a310..0f8846c4d22 100644 --- a/usr.bin/netstat/unix.c +++ b/usr.bin/netstat/unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unix.c,v 1.4 1997/06/29 20:52:42 millert Exp $ */ +/* $OpenBSD: unix.c,v 1.5 1997/06/29 21:46:06 millert Exp $ */ /* $NetBSD: unix.c,v 1.13 1995/10/03 21:42:48 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)unix.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: unix.c,v 1.4 1997/06/29 20:52:42 millert Exp $"; +static char *rcsid = "$OpenBSD: unix.c,v 1.5 1997/06/29 21:46:06 millert Exp $"; #endif #endif /* not lint */ @@ -60,6 +60,7 @@ struct proc; #include <netinet/in.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <kvm.h> @@ -124,15 +125,16 @@ unixdomainpr(so, soaddr) if (first) { printf("Active UNIX domain sockets\n"); printf( -"%-18.18s %-6.6s %-6.6s %-6.6s %18.18s %18.18s %18.18s %18.18s Addr\n", - "Address", "Type", "Recv-Q", "Send-Q", - "Inode", "Conn", "Refs", "Nextref"); +"%-*.*s %-6.6s %-6.6s %-6.6s %*.*s %*.*s %*.*s %*.*s Addr\n", + PLEN, PLEN, "Address", "Type", "Recv-Q", "Send-Q", + PLEN, PLEN, "Inode", PLEN, PLEN, "Conn", + PLEN, PLEN, "Refs", PLEN, PLEN, "Nextref"); first = 0; } - printf("%18p %-6.6s %6ld %6ld %18p %18p %18p %18p", - soaddr, socktype[so->so_type], so->so_rcv.sb_cc, so->so_snd.sb_cc, - unp->unp_vnode, unp->unp_conn, - unp->unp_refs, unp->unp_nextref); + printf("%*p %-6.6s %6ld %6ld %*p %*p %*p %*p", + PLEN, soaddr, socktype[so->so_type], so->so_rcv.sb_cc, + so->so_snd.sb_cc, PLEN, unp->unp_vnode, PLEN, unp->unp_conn, + PLEN, unp->unp_refs, PLEN, unp->unp_nextref); if (m) printf(" %.*s", m->m_len - (int)(sizeof(*sa) - sizeof(sa->sun_path)), |