Author: np
Date: Wed Apr  8 01:25:26 2015
New Revision: 281252
URL: https://svnweb.freebsd.org/changeset/base/281252

Log:
  MFC r280403:
  
  cxgbe(4): Do not call sbuf_trim on an sbuf with a drain function.

Modified:
  stable/10/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/10/sys/dev/cxgbe/t4_main.c   Wed Apr  8 01:16:19 2015        
(r281251)
+++ stable/10/sys/dev/cxgbe/t4_main.c   Wed Apr  8 01:25:26 2015        
(r281252)
@@ -4951,13 +4951,16 @@ cxgbe_sysctls(struct port_info *pi)
 static int
 sysctl_int_array(SYSCTL_HANDLER_ARGS)
 {
-       int rc, *i;
+       int rc, *i, space = 0;
        struct sbuf sb;
 
        sbuf_new(&sb, NULL, 32, SBUF_AUTOEXTEND);
-       for (i = arg1; arg2; arg2 -= sizeof(int), i++)
-               sbuf_printf(&sb, "%d ", *i);
-       sbuf_trim(&sb);
+       for (i = arg1; arg2; arg2 -= sizeof(int), i++) {
+               if (space)
+                       sbuf_printf(&sb, " ");
+               sbuf_printf(&sb, "%d", *i);
+               space = 1;
+       }
        sbuf_finish(&sb);
        rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
        sbuf_delete(&sb);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to