On 20 May 2018 at 23:39, Alexey Dokuchaev <da...@freebsd.org> wrote: > On Mon, May 21, 2018 at 10:32:30AM +1000, Bruce Evans wrote: >> ... >> > if (smpmode && namelength > SMPUNAMELEN) >> > namelength = SMPUNAMELEN; >> > else if (namelength > UPUNAMELEN) >> ...
what about this? commit 7d041879b4d0ad11818b5f5875b1198a722841d7 Author: Eitan Adler <li...@eitanadler.com> Date: Sat May 26 04:30:48 2018 +0000 top(1): allow to configure the max username length Some users prefer shorter names, and MAXLOGNAME is not a perfect method of coming up with a default. Use 8, by request, and allow users to configure it. diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 0f31d87..d6a9b41 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -50,8 +50,9 @@ #include "layout.h" #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) -#define SMPUNAMELEN 13 -#define UPUNAMELEN 15 +#ifndef MAXTOPNAMELEN +#define MAXTOPNAMELEN 8 +#endif extern struct timeval timeout; static int smpmode; @@ -329,11 +330,7 @@ machine_init(struct statics *statics) NULL, 0) == 0 && carc_en == 1) carc_enabled = 1; - namelength = MAXLOGNAME; - if (smpmode && namelength > SMPUNAMELEN) - namelength = SMPUNAMELEN; - else if (namelength > UPUNAMELEN) - namelength = UPUNAMELEN; + namelength = MAXTOPNAMELEN; kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); if (kd == NULL) -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams _______________________________________________ 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"