View | Details | Raw Unified | Return to bug 24760
Collapse All | Expand All

(-)misc/ss.c.orig (-11 / +20 lines)
Lines 320-332 Link Here
320
		if (ptr - buf >= buflen - 1)
320
		if (ptr - buf >= buflen - 1)
321
			break;
321
			break;
322
322
323
		snprintf(ptr, buflen - (ptr - buf),
324
			 "(\"%s\",%d,%d),",
325
			 p->process, p->pid, p->fd);
326
		ptr += strlen(ptr);
327
		cnt++;
328
329
	next:
323
	next:
324
		if (!p->next) {
325
			snprintf(ptr, buflen - (ptr - buf),
326
			 "%*s,%d\n",
327
			 12, p->process, p->pid);
328
			ptr += strlen(ptr);
329
			cnt++;
330
		}
330
		p = p->next;
331
		p = p->next;
331
	}
332
	}
332
333
Lines 1444-1450 Link Here
1444
	if (show_users) {
1445
	if (show_users) {
1445
		char ubuf[4096];
1446
		char ubuf[4096];
1446
		if (find_users(r->idiag_inode, ubuf, sizeof(ubuf)) > 0)
1447
		if (find_users(r->idiag_inode, ubuf, sizeof(ubuf)) > 0)
1447
			printf(" users:(%s)", ubuf);
1448
			printf("%30s", ubuf);
1448
	}
1449
	}
1449
	if (show_details) {
1450
	if (show_details) {
1450
		if (r->idiag_uid)
1451
		if (r->idiag_uid)
Lines 1813-1819 Link Here
1813
	if (show_users) {
1814
	if (show_users) {
1814
		char ubuf[4096];
1815
		char ubuf[4096];
1815
		if (find_users(s.ino, ubuf, sizeof(ubuf)) > 0)
1816
		if (find_users(s.ino, ubuf, sizeof(ubuf)) > 0)
1816
			printf(" users:(%s)", ubuf);
1817
			printf("%30s", ubuf);
1817
	}
1818
	}
1818
1819
1819
	if (show_details) {
1820
	if (show_details) {
Lines 2801-2811 Link Here
2801
		}
2802
		}
2802
	}
2803
	}
2803
2804
2805
	int users_width = 30;
2806
2804
	addrp_width = screen_width;
2807
	addrp_width = screen_width;
2805
	addrp_width -= netid_width+1;
2808
	addrp_width -= netid_width+1;
2806
	addrp_width -= state_width+1;
2809
	addrp_width -= state_width+1;
2807
	addrp_width -= 14;
2810
	addrp_width -= 14;
2808
2811
2812
	if (show_users) {
2813
		addrp_width -= users_width;
2814
	}
2815
2809
	if (addrp_width&1) {
2816
	if (addrp_width&1) {
2810
		if (netid_width)
2817
		if (netid_width)
2811
			netid_width++;
2818
			netid_width++;
Lines 2816-2822 Link Here
2816
	addrp_width /= 2;
2823
	addrp_width /= 2;
2817
	addrp_width--;
2824
	addrp_width--;
2818
2825
2819
	serv_width = resolve_services ? 7 : 5;
2826
	serv_width = resolve_services ? 15 : 5;
2820
2827
2821
	if (addrp_width < 15+serv_width+1)
2828
	if (addrp_width < 15+serv_width+1)
2822
		addrp_width = 15+serv_width+1;
2829
		addrp_width = 15+serv_width+1;
Lines 2829-2838 Link Here
2829
		printf("%-*s ", state_width, "State");
2836
		printf("%-*s ", state_width, "State");
2830
	printf("%-6s %-6s ", "Recv-Q", "Send-Q");
2837
	printf("%-6s %-6s ", "Recv-Q", "Send-Q");
2831
2838
2832
	printf("%*s:%-*s %*s:%-*s\n",
2839
	printf("%*s:%-*s %*s:%-*s",
2833
	       addr_width, "Local Address", serv_width, "Port",
2840
	       addr_width, "Local Address", serv_width, "Port",
2834
	       addr_width, "Peer Address", serv_width, "Port");
2841
	       addr_width, "Peer Address", serv_width, "Port");
2835
2842
	if (show_users)
2843
		printf("%*s", users_width, "Users");
2844
	printf("\n");
2836
	fflush(stdout);
2845
	fflush(stdout);
2837
2846
2838
	if (current_filter.dbs & (1<<NETLINK_DB))
2847
	if (current_filter.dbs & (1<<NETLINK_DB))

Return to bug 24760