From owner-svn-src-stable-11@freebsd.org Sat Dec 31 10:29:01 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AE96C969D5; Sat, 31 Dec 2016 10:29:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B90D1CA5; Sat, 31 Dec 2016 10:29:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBVAT0Uj023672; Sat, 31 Dec 2016 10:29:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVASxmn023661; Sat, 31 Dec 2016 10:28:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612311028.uBVASxmn023661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 31 Dec 2016 10:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310899 - stable/11/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 10:29:01 -0000 Author: ngie Date: Sat Dec 31 10:28:59 2016 New Revision: 310899 URL: https://svnweb.freebsd.org/changeset/base/310899 Log: 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 Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -123,7 +123,7 @@ device_entry_create(const char *name, co 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 Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -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"); } Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index, 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"); } Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Sat Dec 31 10:28:59 2016 (r310899) @@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char 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 *t 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, st switch (curr_op) { - case SNMP_OP_GET: + case SNMP_OP_GET: switch (value->var.subs[sub - 1]) { case LEAF_hrSystemUptime: Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c Sat Dec 31 10:28:59 2016 (r310899) @@ -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 }; Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -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, Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Sat Dec 31 10:27:10 2016 (r310898) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c Sat Dec 31 10:28:59 2016 (r310899) @@ -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:"