summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsnmpd
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-12-31 10:28:59 +0000
committerngie <ngie@FreeBSD.org>2016-12-31 10:28:59 +0000
commitf26e57240e91d732e0eb3083ce4e1048128caa53 (patch)
tree233fd8fe0c912b10b7e27e08c5b348e4858e3b90 /usr.sbin/bsnmpd
parent28495a43e2d368949d74a105f080c0cd6738c94a (diff)
downloadFreeBSD-src-f26e57240e91d732e0eb3083ce4e1048128caa53.zip
FreeBSD-src-f26e57240e91d732e0eb3083ce4e1048128caa53.tar.gz
MFC r310666,r310675:
r310666: style(9) fixes - Clean up trailing whitespace - Fix variable type alignment in storage_OS_get_swap(..) r310675: Fix the build by moving the initializers for len/nswapdev down below the declarations Pointyhat to: ngie
Diffstat (limited to 'usr.sbin/bsnmpd')
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c2
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c4
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c2
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c8
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c6
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c11
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c10
7 files changed, 23 insertions, 20 deletions
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
index 1741502..8216acc 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
@@ -123,7 +123,7 @@ device_entry_create(const char *name, const char *location, const char *descr)
if (map == NULL) {
/* new object - get a new index */
if (next_device_index > INT_MAX) {
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"%s: hrDeviceTable index wrap", __func__);
/* There isn't much we can do here.
* If the next_swins_index is consumed
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
index 91505d5..9470677 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
@@ -131,7 +131,7 @@ static const struct {
const struct asn_oid *oid; /* the OID to return */
} fs_type_map[] = {
{ "ufs", &OIDX_hrFSBerkeleyFFS_c },
- { "zfs", &OIDX_hrFSOther_c },
+ { "zfs", &OIDX_hrFSOther_c },
{ "cd9660", &OIDX_hrFSiso9660_c },
{ "nfs", &OIDX_hrFSNFS_c },
{ "ext2fs", &OIDX_hrFSLinuxExt2_c },
@@ -167,7 +167,7 @@ fs_entry_create(const char *name)
/* new object - get a new index */
if (next_fs_index > INT_MAX) {
/* Unrecoverable error - die clean and quicly*/
- syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
+ syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
errx(EX_SOFTWARE, "hrFSTable index wrap");
}
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
index 65c0012..fa0d2bd 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
@@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index, const char *chunk_name)
if (next_partition_index > INT_MAX) {
/* Unrecoverable error - die clean and quicly*/
- syslog(LOG_ERR, "%s: hrPartitionTable index wrap",
+ syslog(LOG_ERR, "%s: hrPartitionTable index wrap",
__func__);
errx(EX_SOFTWARE, "hrPartitionTable index wrap");
}
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
index ee7d4b1..f5c2e11 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
@@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char **params)
syslog(LOG_ERR, "malloc failed");
return (SNMP_ERR_GENERR);
}
- if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) {
+ if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) {
syslog(LOG_ERR,
"sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m");
free(buf);
@@ -296,7 +296,7 @@ OS_getMemorySize(uint32_t *ms)
*ms = UINT32_MAX;
else
*ms = phys_mem_size;
- return (SNMP_ERR_NOERROR);
+ return (SNMP_ERR_NOERROR);
}
/*
@@ -360,7 +360,7 @@ OS_setSystemDate(const struct timeval *timeval_to_set)
if (settimeofday(timeval_to_set, NULL) == -1) {
syslog(LOG_ERR, "settimeofday failed: %m");
return (SNMP_ERR_GENERR);
- }
+ }
return (SNMP_ERR_NOERROR);
}
@@ -378,7 +378,7 @@ op_hrSystem(struct snmp_context *ctx, struct snmp_value *value,
switch (curr_op) {
- case SNMP_OP_GET:
+ case SNMP_OP_GET:
switch (value->var.subs[sub - 1]) {
case LEAF_hrSystemUptime:
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
index 26bd919..4709c9a 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
@@ -163,7 +163,7 @@ hostres_start(void)
start_processor_tbl(hostres_module);
start_network_tbl();
- HRDBG("done.");
+ HRDBG("done.");
}
/* this identifies the HOST RESOURCES mib module */
@@ -175,8 +175,8 @@ const struct snmp_module config = {
NULL,
NULL,
hostres_start,
- NULL, /* proxy a PDU */
- hostres_ctree, /* see the generated hostres_tree.h */
+ NULL, /* proxy a PDU */
+ hostres_ctree, /* see the generated hostres_tree.h */
hostres_CTREE_SIZE, /* see the generated hostres_tree.h */
NULL
};
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
index ced7e8d..f7b6537 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
@@ -153,7 +153,7 @@ storage_entry_create(const char *name)
if (map == NULL) {
/* new object - get a new index */
if (next_storage_index > INT_MAX) {
- syslog(LOG_ERR,
+ syslog(LOG_ERR,
"%s: hrStorageTable index wrap", __func__);
errx(EX_SOFTWARE, "hrStorageTable index wrap");
}
@@ -188,7 +188,7 @@ storage_entry_create(const char *name)
syslog(LOG_WARNING, "%s: %m", __func__);
return (NULL);
}
- memset(entry, 0, sizeof(*entry));
+ memset(entry, 0, sizeof(*entry));
entry->index = map->hrIndex;
@@ -374,10 +374,13 @@ storage_OS_get_memstat(void)
static void
storage_OS_get_swap(void)
{
- int nswapdev = 0;
- size_t len = sizeof(nswapdev);
struct storage_entry *entry;
char swap_w_prefix[SE_DESC_MLEN];
+ size_t len;
+ int nswapdev;
+
+ len = sizeof(nswapdev);
+ nswapdev = 0;
if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) {
syslog(LOG_ERR,
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c
index 5fa5b4c..c7eecc5 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c
@@ -50,7 +50,7 @@
#include "hostres_oid.h"
#include "hostres_tree.h"
-#define CONTENTS_FNAME "+CONTENTS"
+#define CONTENTS_FNAME "+CONTENTS"
enum SWInstalledType {
SWI_UNKNOWN = 1,
@@ -136,7 +136,7 @@ swins_entry_create(const char *name)
size_t name_len;
/* new object - get a new index */
if (next_swins_index > INT_MAX) {
- syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap",
+ syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap",
__func__ );
/* There isn't much we can do here.
* If the next_swins_index is consumed
@@ -292,7 +292,7 @@ swins_get_packages(void)
struct stat sb;
DIR *p_dir;
struct dirent *ent;
- struct tm k_ts;
+ struct tm k_ts;
char *pkg_file;
struct swins_entry *entry;
int ret = 0;
@@ -327,7 +327,7 @@ swins_get_packages(void)
return (-1);
}
- while (errno = 0, (ent = readdir(p_dir)) != NULL) {
+ while (errno = 0, (ent = readdir(p_dir)) != NULL) {
HRDBG(" pkg file: %s", ent->d_name);
/* check that the contents file is a regular file */
@@ -371,7 +371,7 @@ swins_get_packages(void)
entry->type = (int32_t)SWI_APPLICATION;
entry->date_len = make_date_time(entry->date, &k_ts, 0);
- }
+ }
if (errno != 0) {
syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:"
OpenPOWER on IntegriCloud