]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: force a flush in monitor mode main
authorEric Dumazet <edumazet@google.com>
Wed, 15 Apr 2026 13:03:07 +0000 (13:03 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 15 Apr 2026 14:29:26 +0000 (07:29 -0700)
Call fflush() from generic_show_sock() in order to work
with pipes and redirects.

After this patch, "ss -E &>log_file" works as expected.

Signed-off-by: Eric Dumazet <edumazet@google.com>
misc/ss.c

index 121ca6d55cb7a1ec2ee333b69be72d6affa6178a..9671ba80800806d9fc6c3640f22c91e8b5b2811c 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -5542,6 +5542,7 @@ static int generic_show_sock(struct nlmsghdr *nlh, void *arg)
 
        render();
 
 
        render();
 
+       fflush(stdout);
        return ret;
 }
 
        return ret;
 }