Thread (10 messages) 10 messages, 4 authors, 2019-10-22

Re: [PATCH v2] ss: add option to print socket information on one line

From: Markus Elfring <hidden>
Date: 2019-05-30 09:11:35
Also in: lkml

This software update caught also my development attention a moment ago.

quoted hunk ↗ jump to hunk
+++ b/misc/ss.c
@@ -3973,7 +3975,10 @@ static int packet_show_sock(struct nlmsghdr *nlh, void *arg)

 	if (show_details) {
 		if (pinfo) {
-			out("\n\tver:%d", pinfo->pdi_version);
+			if (oneline)
+				out(" ver:%d", pinfo->pdi_version);
+			else
+				out("\n\tver:%d", pinfo->pdi_version);
 			out(" cpy_thresh:%d", pinfo->pdi_copy_thresh);
 			out(" flags( ");
 			if (pinfo->pdi_flags & PDI_RUNNING)
I would find it nicer to use the ternary operator here.

+			out(oneline ? " ver:%d" : "\n\tver:%d",
+			    pinfo->pdi_version);


How do you think about to use more succinct statement variants?

Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help