mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
ps(1): find_varentry() to take a name instead of a VAR
The only information that find_varentry() needs and uses is a keyword/var name. The rest of the fields in the passed VAR are unused. Changing its signature will ease introducing new calls to find_varentry() in subsequent commits, as there no VAR object will exist to be passed but just a name. Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49609
This commit is contained in:
parent
07a7557add
commit
c1e5a7fdad
3 changed files with 4 additions and 4 deletions
|
|
@ -50,7 +50,7 @@ int donlist(void);
|
|||
char *elapsed(KINFO *, VARENT *);
|
||||
char *elapseds(KINFO *, VARENT *);
|
||||
char *emulname(KINFO *, VARENT *);
|
||||
VARENT *find_varentry(VAR *);
|
||||
VARENT *find_varentry(const char *);
|
||||
const char *fmt_argv(char **, char *, char *, size_t);
|
||||
double getpcpu(const KINFO *);
|
||||
char *jailname(KINFO *, VARENT *);
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ parsefmt(const char *p, struct velisthead *const var_list,
|
|||
* get on with our lives if this VAR is already
|
||||
* represented in the list.
|
||||
*/
|
||||
vent = find_varentry(v);
|
||||
vent = find_varentry(v->name);
|
||||
if (vent != NULL)
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1180,12 +1180,12 @@ init_list(struct listinfo *inf, addelem_rtn artn, int elemsize,
|
|||
}
|
||||
|
||||
VARENT *
|
||||
find_varentry(VAR *v)
|
||||
find_varentry(const char *name)
|
||||
{
|
||||
struct varent *vent;
|
||||
|
||||
STAILQ_FOREACH(vent, &varlist, next_ve) {
|
||||
if (strcmp(vent->var->name, v->name) == 0)
|
||||
if (strcmp(vent->var->name, name) == 0)
|
||||
return vent;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue