Skip to content

Commit

Permalink
unix-socket-links: separate processes by space, replace spaces in names
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-fg committed Aug 6, 2024
1 parent bcd04b0 commit 4eaade8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unix-socket-links
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ def main(args=None):
stdout=sp.PIPE ).stdout.decode('utf-8', 'backslashreplace'))
sock_pids = parse_sock_pids(conns)

nx, ns = '?', lambda s: s if '::' not in s else ns(s.replace('::', ';'))
nx, ns = '?', lambda s: s if '::' not in s else ns(s.replace('::', ':').replace(' ', '_'))
for sock, pid_tuples in sock_pids.items():
if sock_filter and sock != sock_filter: continue
if not opts.conns:
pc, ps = set(), set()
for pids in pid_tuples: pc.update(pids.c); ps.update(pids.s)
pid_tuples = [conn_pids_t(pc, ps, '')]
for pids in pid_tuples:
pc, ps = (ns(', '.join(sorted(set(pp)))) for pp in [pids.c, pids.s])
pc, ps = (ns(' '.join(sorted(set(pp)))) for pp in [pids.c, pids.s])
print(f'{sock} :: {ps or nx}{pids.st} :: {pc or nx}')

if __name__ == '__main__':
Expand Down

0 comments on commit 4eaade8

Please sign in to comment.