]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: Add missing tab when printing UNIX details
authorPhil Sutter <phil@nwl.cc>
Fri, 2 Dec 2016 10:39:47 +0000 (11:39 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:07:46 +0000 (14:07 -0800)
When dumping UNIX sockets and show_details is active but not show_mem
(ss -xne), the socket details are printed without being prefixed by tab.
Fix this by printing the tab character when either one of '-e' or '-m'
has been specified.

Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c

index 18ccb6dbfd099658f12f2823eecddbd847f94674..bb46e49ff2fbb34bf09c3cb245b66b1b5de71b55 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3139,10 +3139,10 @@ static int unix_show_sock(const struct sockaddr_nl *addr, struct nlmsghdr *nlh,
 
        unix_stats_print(&stat, f);
 
-       if (show_mem) {
+       if (show_mem || show_details)
                printf("\t");
+       if (show_mem)
                print_skmeminfo(tb, UNIX_DIAG_MEMINFO);
-       }
        if (show_details) {
                if (tb[UNIX_DIAG_SHUTDOWN]) {
                        unsigned char mask;