diff options
author | Quentin Deslandes <qde@naccy.de> | 2023-12-06 12:14:44 +0100 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2023-12-06 09:41:09 -0800 |
commit | 1607bf531fd2f984438d227ea97312df80e7cf56 (patch) | |
tree | 87f943417df19edaadf1cb8653ce6623f60d50d1 | |
parent | 4913a5c2068cd51ae17307d4f201a1d94d216bd5 (diff) | |
download | iproute2-next-1607bf531fd2f984438d227ea97312df80e7cf56.tar.gz |
ss: prevent "Process" column from being printed unless requested
Commit 5883c6eba517 ("ss: show header for --processes/-p") added
"Process" to the list of columns printed by ss. However, the "Process"
header is now printed even if --processes/-p is not used.
This change aims to fix this by moving the COL_PROC column ID to the same
index as the corresponding column structure in the columns array, and
enabling it if --processes/-p is used.
Fixes: 5883c6eba517 ("ss: show header for --processes/-p")
Signed-off-by: Quentin Deslandes <qde@naccy.de>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r-- | misc/ss.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -100,8 +100,8 @@ enum col_id { COL_SERV, COL_RADDR, COL_RSERV, - COL_EXT, COL_PROC, + COL_EXT, COL_MAX }; @@ -5795,6 +5795,9 @@ int main(int argc, char *argv[]) if (ssfilter_parse(¤t_filter.f, argc, argv, filter_fp)) usage(); + if (!show_processes) + columns[COL_PROC].disabled = 1; + if (!(current_filter.dbs & (current_filter.dbs - 1))) columns[COL_NETID].disabled = 1; |