style(9) fixes
- Clean up trailing whitespace - Fix variable type alignment in storage_OS_get_swap(..) MFC after: 3 days
This commit is contained in:
parent
4568bf74f4
commit
c4648c7562
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=310666
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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,10 @@ 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 = sizeof(nswapdev);
|
||||
int nswapdev = 0;
|
||||
|
||||
if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) {
|
||||
syslog(LOG_ERR,
|
||||
|
@ -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:"
|
||||
|
Loading…
Reference in New Issue
Block a user