Only call flush in pipe mode.

It fixes a crash with a socket in top mode.

Ex:
# pmcstat -R 127.0.0.1:8080 -T -w1
then
# pmcstat -n1 -Sclock.prof -Slock.failed -O 127.0.0.1:8080

MFC after:	1 week
Sponsored by:	Stormshield
This commit is contained in:
Fabien Thomas 2018-01-17 16:55:35 +00:00
parent 9f4f1d4d1f
commit cb43ed2815
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328088

View file

@ -1350,6 +1350,7 @@ main(int argc, char **argv)
}
/* print out counting PMCs */
if ((args.pa_flags & FLAG_DO_TOP) &&
(args.pa_flags & FLAG_HAS_PIPE) &&
pmc_flush_logfile() == 0)
do_read = 1;
do_print = 1;