Re-indent machine* files.
This commit is contained in:
1 parent
e45822c37d
commit
27d1bc1087
7 files changed
+861
-863
No files matched your search
+164
-174
@@ -2,7 +2,8 @@
|
||||
* Collects system information on FreeBSD.
|
||||
*/
|
||||
|
||||
/* Copyright (c) 2003 Thomas Runge (coto@core.de)
|
||||
/*-
|
||||
* Copyright (c) 2003 Thomas Runge (coto@core.de)
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -76,13 +77,16 @@ static kvm_t *kvmd;
|
||||
static int swapmode(int *retavail, int *retfree);
|
||||
|
||||
|
||||
int machine_init(void)
|
||||
int
|
||||
machine_init(void)
|
||||
{
|
||||
/* get the page size with "getpagesize" and calculate pageshift from it */
|
||||
/*
|
||||
* get the page size with "getpagesize" and calculate pageshift from
|
||||
* it
|
||||
*/
|
||||
int pagesize = getpagesize();
|
||||
pageshift = 0;
|
||||
while (pagesize > 1)
|
||||
{
|
||||
while (pagesize > 1) {
|
||||
pageshift++;
|
||||
pagesize >>= 1;
|
||||
}
|
||||
@@ -91,73 +95,70 @@ int machine_init(void)
|
||||
pageshift -= 10;
|
||||
|
||||
/* open kernel virtual memory */
|
||||
if ((kvmd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
|
||||
{
|
||||
if ((kvmd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) {
|
||||
perror("kvm_open");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_close(void)
|
||||
int
|
||||
machine_close(void)
|
||||
{
|
||||
kvm_close(kvmd);
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_battstat(int *acstat, int *battflag, int *percent)
|
||||
int
|
||||
machine_get_battstat(int *acstat, int *battflag, int *percent)
|
||||
{
|
||||
*acstat = LCDP_AC_ON;
|
||||
*acstat = LCDP_AC_ON;
|
||||
*battflag = LCDP_BATT_ABSENT;
|
||||
*percent = 100;
|
||||
*percent = 100;
|
||||
|
||||
#ifdef HAVE_MACHINE_APM_BIOS_H
|
||||
int apmd;
|
||||
struct apm_info aip;
|
||||
|
||||
if ((apmd = open("/dev/apm", O_RDONLY)) == -1)
|
||||
{
|
||||
if ((apmd = open("/dev/apm", O_RDONLY)) == -1) {
|
||||
perror("get_battstat_open");
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
if (ioctl(apmd, APMIO_GETINFO, &aip) == -1)
|
||||
{
|
||||
if (ioctl(apmd, APMIO_GETINFO, &aip) == -1) {
|
||||
perror("get_battstat_ioctl");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
switch(aip.ai_acline)
|
||||
{
|
||||
case 0:
|
||||
*acstat = LCDP_AC_OFF;
|
||||
break;
|
||||
case 1:
|
||||
*acstat = LCDP_AC_ON;
|
||||
break;
|
||||
default:
|
||||
*acstat = LCDP_AC_UNKNOWN;
|
||||
break;
|
||||
switch (aip.ai_acline) {
|
||||
case 0:
|
||||
*acstat = LCDP_AC_OFF;
|
||||
break;
|
||||
case 1:
|
||||
*acstat = LCDP_AC_ON;
|
||||
break;
|
||||
default:
|
||||
*acstat = LCDP_AC_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(aip.ai_batt_stat)
|
||||
{
|
||||
case 0:
|
||||
*battflag = LCDP_BATT_HIGH;
|
||||
break;
|
||||
case 1:
|
||||
*battflag = LCDP_BATT_LOW;
|
||||
break;
|
||||
case 2:
|
||||
*battflag = LCDP_BATT_CRITICAL;
|
||||
break;
|
||||
case 3:
|
||||
*battflag = LCDP_BATT_CHARGING;
|
||||
break;
|
||||
default:
|
||||
*battflag = LCDP_BATT_UNKNOWN;
|
||||
break;
|
||||
switch (aip.ai_batt_stat) {
|
||||
case 0:
|
||||
*battflag = LCDP_BATT_HIGH;
|
||||
break;
|
||||
case 1:
|
||||
*battflag = LCDP_BATT_LOW;
|
||||
break;
|
||||
case 2:
|
||||
*battflag = LCDP_BATT_CRITICAL;
|
||||
break;
|
||||
case 3:
|
||||
*battflag = LCDP_BATT_CHARGING;
|
||||
break;
|
||||
default:
|
||||
*battflag = LCDP_BATT_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
*percent = aip.ai_batt_life;
|
||||
@@ -167,42 +168,39 @@ int machine_get_battstat(int *acstat, int *battflag, int *percent)
|
||||
close(apmd);
|
||||
#endif
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_fs(mounts_type fs[], int *cnt)
|
||||
int
|
||||
machine_get_fs(mounts_type fs[], int *cnt)
|
||||
{
|
||||
struct statfs *mntbuf;
|
||||
struct statfs *pp;
|
||||
int statcnt, fscnt, i;
|
||||
|
||||
fscnt = getmntinfo(&mntbuf, MNT_WAIT);
|
||||
if (fscnt == 0)
|
||||
{
|
||||
if (fscnt == 0) {
|
||||
perror("getmntinfo");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
for (statcnt = 0, pp = mntbuf, i = 0; i < fscnt; pp++, i++)
|
||||
{
|
||||
if ( strcmp(pp->f_fstypename, "procfs")
|
||||
&& strcmp(pp->f_fstypename, "devfs")
|
||||
&& strcmp(pp->f_fstypename, "kernfs")
|
||||
&& strcmp(pp->f_fstypename, "linprocfs")
|
||||
for (statcnt = 0, pp = mntbuf, i = 0; i < fscnt; pp++, i++) {
|
||||
if (strcmp(pp->f_fstypename, "procfs")
|
||||
&& strcmp(pp->f_fstypename, "devfs")
|
||||
&& strcmp(pp->f_fstypename, "kernfs")
|
||||
&& strcmp(pp->f_fstypename, "linprocfs")
|
||||
#ifndef STAT_NFS
|
||||
&& strcmp(pp->f_fstypename, "nfs")
|
||||
&& strcmp(pp->f_fstypename, "nfs")
|
||||
#endif
|
||||
#ifndef STAT_SMBFS
|
||||
&& strcmp(pp->f_fstypename, "smbfs")
|
||||
&& strcmp(pp->f_fstypename, "smbfs")
|
||||
#endif
|
||||
)
|
||||
{
|
||||
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
|
||||
) {
|
||||
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
|
||||
snprintf(fs[statcnt].mpoint, 255, "%s", pp->f_mntonname);
|
||||
snprintf(fs[statcnt].type, 63, "%s", pp->f_fstypename);
|
||||
snprintf(fs[statcnt].type, 63, "%s", pp->f_fstypename);
|
||||
|
||||
fs[statcnt].blocks = pp->f_blocks;
|
||||
if (fs[statcnt].blocks > 0)
|
||||
{
|
||||
if (fs[statcnt].blocks > 0) {
|
||||
fs[statcnt].bsize = pp->f_bsize;
|
||||
fs[statcnt].bfree = pp->f_bfree;
|
||||
fs[statcnt].files = pp->f_files;
|
||||
@@ -214,123 +212,118 @@ int machine_get_fs(mounts_type fs[], int *cnt)
|
||||
|
||||
*cnt = statcnt;
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_load(load_type *curr_load)
|
||||
int
|
||||
machine_get_load(load_type * curr_load)
|
||||
{
|
||||
static load_type last_load = { 0, 0, 0, 0, 0 };
|
||||
static load_type last_load = {0, 0, 0, 0, 0};
|
||||
static load_type last_ret_load;
|
||||
load_type load;
|
||||
long cp_time[CPUSTATES];
|
||||
size_t size;
|
||||
|
||||
size = sizeof(cp_time);
|
||||
if (sysctlbyname("kern.cp_time", cp_time, &size, NULL, 0) < 0)
|
||||
{
|
||||
if (sysctlbyname("kern.cp_time", cp_time, &size, NULL, 0) < 0) {
|
||||
perror("sysctl kern.cp_time failed");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
load.user = (unsigned long) (cp_time[CP_USER]);
|
||||
load.nice = (unsigned long) (cp_time[CP_NICE]);
|
||||
load.system = (unsigned long) (cp_time[CP_SYS] + cp_time[CP_INTR]);
|
||||
load.idle = (unsigned long) (cp_time[CP_IDLE]);
|
||||
load.total = load.user + load.nice + load.system + load.idle;
|
||||
load.user = (unsigned long)(cp_time[CP_USER]);
|
||||
load.nice = (unsigned long)(cp_time[CP_NICE]);
|
||||
load.system = (unsigned long)(cp_time[CP_SYS] + cp_time[CP_INTR]);
|
||||
load.idle = (unsigned long)(cp_time[CP_IDLE]);
|
||||
load.total = load.user + load.nice + load.system + load.idle;
|
||||
|
||||
if (load.total != last_load.total)
|
||||
{
|
||||
curr_load->user = load.user - last_load.user;
|
||||
curr_load->nice = load.nice - last_load.nice;
|
||||
if (load.total != last_load.total) {
|
||||
curr_load->user = load.user - last_load.user;
|
||||
curr_load->nice = load.nice - last_load.nice;
|
||||
curr_load->system = load.system - last_load.system;
|
||||
curr_load->idle = load.idle - last_load.idle;
|
||||
curr_load->total = load.total - last_load.total;
|
||||
curr_load->idle = load.idle - last_load.idle;
|
||||
curr_load->total = load.total - last_load.total;
|
||||
last_ret_load = *curr_load;
|
||||
last_load = load;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
*curr_load = last_ret_load;
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_loadavg(double *load)
|
||||
int
|
||||
machine_get_loadavg(double *load)
|
||||
{
|
||||
double loadavg[LOADAVG_NSTATS];
|
||||
|
||||
if (getloadavg(loadavg, LOADAVG_NSTATS) <= LOADAVG_1MIN)
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
|
||||
*load = loadavg[LOADAVG_1MIN];
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_meminfo(meminfo_type *result)
|
||||
int
|
||||
machine_get_meminfo(meminfo_type * result)
|
||||
{
|
||||
int total_pages, free_pages;
|
||||
size_t size;
|
||||
|
||||
size = sizeof(int);
|
||||
|
||||
if (sysctlbyname("vm.stats.vm.v_page_count", &total_pages, &size, NULL, 0) < 0)
|
||||
{
|
||||
if (sysctlbyname("vm.stats.vm.v_page_count", &total_pages, &size, NULL, 0) < 0) {
|
||||
perror("sysctl vm.stats.vm.v_page_count");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if (sysctlbyname("vm.stats.vm.v_free_count", &free_pages, &size, NULL, 0) < 0)
|
||||
{
|
||||
if (sysctlbyname("vm.stats.vm.v_free_count", &free_pages, &size, NULL, 0) < 0) {
|
||||
perror("sysctl vm.stats.vm.v_free_count");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* memory */
|
||||
result[0].total = pagetok(total_pages);
|
||||
result[0].free = pagetok(free_pages);
|
||||
result[0].total = pagetok(total_pages);
|
||||
result[0].free = pagetok(free_pages);
|
||||
|
||||
/* unused anyway */
|
||||
result[0].shared = 0;
|
||||
result[0].shared = 0;
|
||||
result[0].buffers = 0;
|
||||
result[0].cache = 0;
|
||||
result[0].cache = 0;
|
||||
|
||||
/* swap */
|
||||
result[1].total = 0;
|
||||
result[1].free = 0;
|
||||
result[1].total = 0;
|
||||
result[1].free = 0;
|
||||
|
||||
if (swapmode(&total_pages, &free_pages) != -1)
|
||||
{
|
||||
if (swapmode(&total_pages, &free_pages) != -1) {
|
||||
result[1].total = total_pages;
|
||||
result[1].free = free_pages;
|
||||
result[1].free = free_pages;
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_procs(LinkedList *procs)
|
||||
int
|
||||
machine_get_procs(LinkedList * procs)
|
||||
{
|
||||
struct kinfo_proc *kprocs;
|
||||
int nproc, i;
|
||||
procinfo_type *p;
|
||||
|
||||
kprocs = kvm_getprocs(kvmd, KERN_PROC_ALL, 0, &nproc);
|
||||
if (kprocs == NULL)
|
||||
{
|
||||
if (kprocs == NULL) {
|
||||
perror("kvm_getprocs");
|
||||
kvm_close(kvmd);
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
for (i = 0; i < nproc; i++)
|
||||
{
|
||||
for (i = 0; i < nproc; i++) {
|
||||
p = malloc(sizeof(procinfo_type));
|
||||
if (!p)
|
||||
{
|
||||
if (!p) {
|
||||
perror("mem_top_malloc");
|
||||
kvm_close(kvmd);
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
#if (__FreeBSD_version > 500000)
|
||||
strncpy(p->name, kprocs->ki_comm, 15);
|
||||
@@ -350,10 +343,11 @@ int machine_get_procs(LinkedList *procs)
|
||||
kprocs++;
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_smpload(load_type *result, int *numcpus)
|
||||
int
|
||||
machine_get_smpload(load_type * result, int *numcpus)
|
||||
{
|
||||
int i, num;
|
||||
size_t size;
|
||||
@@ -364,12 +358,12 @@ int machine_get_smpload(load_type *result, int *numcpus)
|
||||
#endif
|
||||
|
||||
if (numcpus == NULL)
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
|
||||
size = sizeof(int);
|
||||
if (sysctlbyname("hw.ncpu", &num, &size, NULL, 0) < 0) {
|
||||
perror("sysctl hw.ncpu");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* restrict #CPUs to max. *numcpus */
|
||||
@@ -378,37 +372,37 @@ int machine_get_smpload(load_type *result, int *numcpus)
|
||||
|
||||
#ifndef HAVE_SYS_PCPU_H
|
||||
if (machine_get_load(&load) == FALSE)
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
#ifdef HAVE_SYS_PCPU_H
|
||||
pcpudata = kvm_getpcpu(kvmd, i);
|
||||
|
||||
if (pcpudata == NULL || pcpudata == (void *) -1)
|
||||
return(FALSE);
|
||||
if (pcpudata == NULL || pcpudata == (void *)-1)
|
||||
return (FALSE);
|
||||
|
||||
/* extract the data for single CPU */
|
||||
load.user = (unsigned long) (pcpudata->pc_cp_time[CP_USER]);
|
||||
load.nice = (unsigned long) (pcpudata->pc_cp_time[CP_NICE]);
|
||||
load.system = (unsigned long) (pcpudata->pc_cp_time[CP_SYS] +
|
||||
pcpudata->pc_cp_time[CP_INTR]);
|
||||
load.idle = (unsigned long) (pcpudata->pc_cp_time[CP_IDLE]);
|
||||
load.total = load.user + load.nice + load.system + load.idle;
|
||||
load.user = (unsigned long)(pcpudata->pc_cp_time[CP_USER]);
|
||||
load.nice = (unsigned long)(pcpudata->pc_cp_time[CP_NICE]);
|
||||
load.system = (unsigned long)(pcpudata->pc_cp_time[CP_SYS] +
|
||||
pcpudata->pc_cp_time[CP_INTR]);
|
||||
load.idle = (unsigned long)(pcpudata->pc_cp_time[CP_IDLE]);
|
||||
load.total = load.user + load.nice + load.system + load.idle;
|
||||
|
||||
/* store difference in result */
|
||||
result[i].user = load.user - last_load[i].user;
|
||||
result[i].nice = load.nice - last_load[i].nice;
|
||||
result[i].user = load.user - last_load[i].user;
|
||||
result[i].nice = load.nice - last_load[i].nice;
|
||||
result[i].system = load.system - last_load[i].system;
|
||||
result[i].idle = load.idle - last_load[i].idle;
|
||||
result[i].total = load.total - last_load[i].total;
|
||||
result[i].idle = load.idle - last_load[i].idle;
|
||||
result[i].total = load.total - last_load[i].total;
|
||||
|
||||
/* store current value for next round */
|
||||
last_load[i].user = load.user;
|
||||
last_load[i].nice = load.nice;
|
||||
last_load[i].user = load.user;
|
||||
last_load[i].nice = load.nice;
|
||||
last_load[i].system = load.system;
|
||||
last_load[i].idle = load.idle;
|
||||
last_load[i].total = load.total;
|
||||
last_load[i].idle = load.idle;
|
||||
last_load[i].total = load.total;
|
||||
|
||||
/* free pcpu buffer */
|
||||
free(pcpudata);
|
||||
@@ -417,10 +411,11 @@ int machine_get_smpload(load_type *result, int *numcpus)
|
||||
#endif
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int machine_get_uptime(double *up, double *idle)
|
||||
int
|
||||
machine_get_uptime(double *up, double *idle)
|
||||
{
|
||||
size_t size;
|
||||
time_t now;
|
||||
@@ -429,10 +424,9 @@ int machine_get_uptime(double *up, double *idle)
|
||||
|
||||
size = sizeof(boottime);
|
||||
time(&now);
|
||||
if (sysctlbyname("kern.boottime", &boottime, &size, NULL, 0) < 0)
|
||||
{
|
||||
if (sysctlbyname("kern.boottime", &boottime, &size, NULL, 0) < 0) {
|
||||
perror("sysctl kern.cp_time failed");
|
||||
return(FALSE);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
*up = (double)(now - boottime.tv_sec);
|
||||
@@ -440,12 +434,13 @@ int machine_get_uptime(double *up, double *idle)
|
||||
if (machine_get_load(&curr_load) == FALSE)
|
||||
*idle = 100.;
|
||||
else
|
||||
*idle = 100.*curr_load.idle/curr_load.total;
|
||||
*idle = 100. * curr_load.idle / curr_load.total;
|
||||
|
||||
return(TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static int swapmode(int *retavail, int *retfree)
|
||||
static int
|
||||
swapmode(int *retavail, int *retfree)
|
||||
{
|
||||
int n;
|
||||
struct kvm_swap swapary[1];
|
||||
@@ -454,50 +449,45 @@ static int swapmode(int *retavail, int *retfree)
|
||||
*retavail = 0;
|
||||
*retfree = 0;
|
||||
|
||||
if ((kvmd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
|
||||
{
|
||||
if ((kvmd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) {
|
||||
perror("read kvm");
|
||||
return(-1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
n = kvm_getswapinfo(kvmd, swapary, 1, 0);
|
||||
if (n < 0 || swapary[0].ksw_total == 0)
|
||||
{
|
||||
if (n < 0 || swapary[0].ksw_total == 0) {
|
||||
/* strange */
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
*retavail = pagetok(swapary[0].ksw_total);
|
||||
*retfree = pagetok(swapary[0].ksw_total - swapary[0].ksw_used);
|
||||
*retfree = pagetok(swapary[0].ksw_total - swapary[0].ksw_used);
|
||||
}
|
||||
|
||||
kvm_close(kvmd);
|
||||
|
||||
return(n);
|
||||
return (n);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Read interface statistics from system and store in the struct
|
||||
* passed as a pointer. If there are no errors, it returns 1. If errors,
|
||||
* returns 0.
|
||||
*************************************************************************
|
||||
*/
|
||||
int machine_get_iface_stats (IfaceInfo *interface)
|
||||
int
|
||||
machine_get_iface_stats(IfaceInfo * interface)
|
||||
{
|
||||
int rows;
|
||||
int name[6] = {CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, 0, IFDATA_GENERAL};
|
||||
size_t len;
|
||||
struct ifmibdata ifmd; /* ifmibdata contains the network statistics */
|
||||
int rows;
|
||||
int name[6] = {CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, 0, IFDATA_GENERAL};
|
||||
size_t len;
|
||||
struct ifmibdata ifmd; /* ifmibdata contains the network statistics */
|
||||
|
||||
len = sizeof(rows);
|
||||
/* get number of interfaces */
|
||||
if (sysctlbyname("net.link.generic.system.ifcount", &rows, &len, NULL, 0) == 0) {
|
||||
interface->status = down; /* set status down by default */
|
||||
interface->status = down; /* set status down by default */
|
||||
|
||||
len = sizeof(ifmd);
|
||||
/* walk through all interfaces in the ifmib table from last to first */
|
||||
for ( ; rows > 0; rows--) {
|
||||
name[4] = rows; /* set the interface index */
|
||||
/*
|
||||
* walk through all interfaces in the ifmib table from last
|
||||
* to first
|
||||
*/
|
||||
for (; rows > 0; rows--) {
|
||||
name[4] = rows; /* set the interface index */
|
||||
/* retrive the ifmibdata for the current index */
|
||||
if (sysctl(name, 6, &ifmd, &len, NULL, 0) == -1) {
|
||||
perror("read sysctl");
|
||||
@@ -519,7 +509,7 @@ int machine_get_iface_stats (IfaceInfo *interface)
|
||||
}
|
||||
|
||||
if ((ifmd.ifmd_flags & IFF_UP) == IFF_UP) {
|
||||
interface->status = up; /* is up */
|
||||
interface->status = up; /* is up */
|
||||
interface->last_online = time(NULL); /* save actual time */
|
||||
}
|
||||
|
||||
@@ -528,11 +518,11 @@ int machine_get_iface_stats (IfaceInfo *interface)
|
||||
}
|
||||
/* if we are here there is no interface with the given name */
|
||||
return (TRUE);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
perror("read sysctlbyname");
|
||||
return (FALSE);
|
||||
}
|
||||
} /* get_iface_stats() */
|
||||
}
|
||||
|
||||
|
||||
#endif /* __FreeBSD__ */
|
||||
#endif /* __FreeBSD__ */
|
||||
Reference in new issue
Block a user