Author: fabient
Date: Wed Jan 17 16:55:35 2018
New Revision: 328088
URL: https://svnweb.freebsd.org/changeset/base/328088

Log:
  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

Modified:
  head/usr.sbin/pmcstat/pmcstat.c

Modified: head/usr.sbin/pmcstat/pmcstat.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcstat.c     Wed Jan 17 16:41:22 2018        
(r328087)
+++ head/usr.sbin/pmcstat/pmcstat.c     Wed Jan 17 16:55:35 2018        
(r328088)
@@ -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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to