devlink: Add fflush() in cmd_mon_show_cb()
Similar to other print functions we need to flush buffered data in order to work with pipes and output redirects. Without it, stdout output is buffered and not written to the disk. This is useful when writing scripts that rely on devlink-monitor output. Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
7e7a1d107b
commit
8e6bce735a
|
|
@ -4654,6 +4654,7 @@ static int cmd_mon_show_cb(const struct nlmsghdr *nlh, void *data)
|
|||
pr_out_trap_policer(dl, tb, false);
|
||||
break;
|
||||
}
|
||||
fflush(stdout);
|
||||
return MNL_CB_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue