mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
procstat_getpathname: for kvm method, instead of returning the error
that the method is not supported, return an empty string. This looks more handy for callers like procstat(1), which will not abort after the failed call and still output some useful information. MFC after: 3 weeks
This commit is contained in:
parent
1f84c47e42
commit
dd70ad64bf
1 changed files with 4 additions and 2 deletions
|
|
@ -2114,8 +2114,10 @@ procstat_getpathname(struct procstat *procstat, struct kinfo_proc *kp,
|
|||
{
|
||||
switch(procstat->type) {
|
||||
case PROCSTAT_KVM:
|
||||
warnx("kvm method is not supported");
|
||||
return (-1);
|
||||
/* XXX: Return empty string. */
|
||||
if (maxlen > 0)
|
||||
pathname[0] = '\0';
|
||||
return (0);
|
||||
case PROCSTAT_SYSCTL:
|
||||
return (procstat_getpathname_sysctl(kp->ki_pid, pathname,
|
||||
maxlen));
|
||||
|
|
|
|||
Loading…
Reference in a new issue