On Wed, Nov 12, 2014 at 10:27:30AM -0500, Ted Unangst wrote:
> the output is easier to interpret and check if it's sorted.
>
OK reyk@
(but remember that we should put it in #ifndef SMALL if we decide to
move list_cloners() out of it)
> Index: ifconfig.c
> ===================================================================
> RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
> retrieving revision 1.287
> diff -u -p -r1.287 ifconfig.c
> --- ifconfig.c 12 Jul 2014 19:58:17 -0000 1.287
> +++ ifconfig.c 12 Nov 2014 15:26:50 -0000
> @@ -1083,6 +1083,9 @@ list_cloners(void)
> if (ifcr.ifcr_count > ifcr.ifcr_total)
> ifcr.ifcr_count = ifcr.ifcr_total;
>
> + qsort(buf, ifcr.ifcr_count, IFNAMSIZ,
> + (int(*)(const void *, const void *))strcmp);
> +
> for (cp = buf, idx = 0; idx < ifcr.ifcr_count; idx++, cp += IFNAMSIZ) {
> if (idx > 0)
> putchar(' ');
>
--