FreeBSD: drop unused jail_errmsg variable

This commit is contained in:
Christian Göttsche 2021-01-27 15:11:56 +01:00 committed by BenBE
parent 399add39ca
commit 79620d01c0
2 changed files with 16 additions and 35 deletions

View File

@ -40,8 +40,6 @@ in the source distribution for its full text.
#include "zfs/openzfs_sysctl.h"
char jail_errmsg[JAIL_ERRMSGLEN];
static int MIB_hw_physmem[2];
static int MIB_vm_stats_vm_v_page_count[4];
static int pageSize;
@ -413,13 +411,12 @@ static char* FreeBSDProcessList_readProcessName(kvm_t* kd, const struct kinfo_pr
}
static char* FreeBSDProcessList_readJailName(const struct kinfo_proc* kproc) {
char* jname = NULL;
char jnamebuf[MAXHOSTNAMELEN];
if (kproc->ki_jid == 0)
return xStrdup("-");
if (kproc->ki_jid != 0) {
struct iovec jiov[6];
char jnamebuf[MAXHOSTNAMELEN] = {0};
struct iovec jiov[4];
memset(jnamebuf, 0, sizeof(jnamebuf));
IGNORE_WCASTQUAL_BEGIN
*(const void**)&jiov[0].iov_base = "jid";
jiov[0].iov_len = sizeof("jid");
@ -429,26 +426,13 @@ IGNORE_WCASTQUAL_BEGIN
jiov[2].iov_len = sizeof("name");
jiov[3].iov_base = jnamebuf;
jiov[3].iov_len = sizeof(jnamebuf);
*(const void**)&jiov[4].iov_base = "errmsg";
jiov[4].iov_len = sizeof("errmsg");
jiov[5].iov_base = jail_errmsg;
jiov[5].iov_len = JAIL_ERRMSGLEN;
IGNORE_WCASTQUAL_END
jail_errmsg[0] = 0;
int jid = jail_get(jiov, 6, 0);
if (jid < 0) {
if (!jail_errmsg[0]) {
xSnprintf(jail_errmsg, JAIL_ERRMSGLEN, "jail_get: %s", strerror(errno));
}
} else if (jid == kproc->ki_jid) {
jname = xStrdup(jnamebuf);
}
} else {
jname = xStrdup("-");
}
int jid = jail_get(jiov, 4, 0);
if (jid == kproc->ki_jid)
return xStrdup(jnamebuf);
return jname;
return NULL;
}
void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {

View File

@ -17,9 +17,6 @@ in the source distribution for its full text.
#include "zfs/ZfsArcStats.h"
#define JAIL_ERRMSGLEN 1024
extern char jail_errmsg[JAIL_ERRMSGLEN];
typedef struct CPUData_ {
double userPercent;
double nicePercent;