diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/amd/include/Makefile | 4 | ||||
-rw-r--r-- | usr.sbin/cron/cron/do_command.c | 5 | ||||
-rw-r--r-- | usr.sbin/cron/crontab/crontab.c | 2 | ||||
-rw-r--r-- | usr.sbin/ctld/Makefile.depend | 2 | ||||
-rw-r--r-- | usr.sbin/iostat/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/iostat/iostat.c | 47 | ||||
-rw-r--r-- | usr.sbin/pciconf/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/pciconf/cap.c | 8 | ||||
-rw-r--r-- | usr.sbin/pciconf/pciconf.c | 49 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 5 |
10 files changed, 65 insertions, 61 deletions
diff --git a/usr.sbin/amd/include/Makefile b/usr.sbin/amd/include/Makefile index e594d71..db70b6e 100644 --- a/usr.sbin/amd/include/Makefile +++ b/usr.sbin/amd/include/Makefile @@ -17,9 +17,9 @@ CLEANFILES= ${SRCS} all depend: ${SRCS} -config_local.h: newvers.sh +config_local.h: newvers.sh ${.CURDIR}/../../../sys/conf/newvers.sh @rm -f ${.TARGET} - sh ${.ALLSRC} ${.CURDIR}/../../../sys/conf/newvers.sh > ${.TARGET} + sh ${.ALLSRC} > ${.TARGET} localconfig.h: @rm -f ${.TARGET} diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c index 7a7ac57..4d7c1f4 100644 --- a/usr.sbin/cron/cron/do_command.c +++ b/usr.sbin/cron/cron/do_command.c @@ -337,8 +337,9 @@ child_process(e, u) _exit(OK_EXIT); } # endif /*DEBUGGING*/ - execle(shell, shell, "-c", e->cmd, (char *)0, e->envp); - warn("execl: couldn't exec `%s'", shell); + execle(shell, shell, "-c", e->cmd, (char *)NULL, + e->envp); + warn("execle: couldn't exec `%s'", shell); _exit(ERROR_EXIT); } break; diff --git a/usr.sbin/cron/crontab/crontab.c b/usr.sbin/cron/crontab/crontab.c index f2e97a7..2608be7 100644 --- a/usr.sbin/cron/crontab/crontab.c +++ b/usr.sbin/cron/crontab/crontab.c @@ -532,7 +532,7 @@ replace_cmd() { Set_LineNum(1) while (EOF != (ch = get_char(NewCrontab))) putc(ch, tmp); - ftruncate(fileno(tmp), ftell(tmp)); + ftruncate(fileno(tmp), ftello(tmp)); fflush(tmp); rewind(tmp); if (ferror(tmp)) { diff --git a/usr.sbin/ctld/Makefile.depend b/usr.sbin/ctld/Makefile.depend index ece2325..a7783f1 100644 --- a/usr.sbin/ctld/Makefile.depend +++ b/usr.sbin/ctld/Makefile.depend @@ -13,7 +13,9 @@ DIRDEPS = \ lib/libexpat \ lib/libmd \ lib/libsbuf \ + lib/libucl \ lib/libutil \ + lib/msun \ usr.bin/lex/lib \ usr.bin/yacc.host \ diff --git a/usr.sbin/iostat/Makefile b/usr.sbin/iostat/Makefile index dfbf69d..4d74fe1 100644 --- a/usr.sbin/iostat/Makefile +++ b/usr.sbin/iostat/Makefile @@ -6,6 +6,4 @@ MAN= iostat.8 LIBADD= devstat kvm m -WARNS?= 1 - .include <bsd.prog.mk> diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 170ce0d..7610a7f 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -117,30 +117,34 @@ #include <termios.h> #include <unistd.h> -struct nlist namelist[] = { +static struct nlist namelist[] = { #define X_TTY_NIN 0 - { "_tty_nin" }, + { .n_name = "_tty_nin", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_TTY_NOUT 1 - { "_tty_nout" }, + { .n_name = "_tty_nout", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_BOOTTIME 2 - { "_boottime" }, + { .n_name = "_boottime", + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, #define X_END 2 - { NULL }, + { .n_name = NULL, + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 }, }; #define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */ -struct statinfo cur, last; -int num_devices; -struct device_selection *dev_select; -int maxshowdevs; -volatile sig_atomic_t headercount; -volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ -volatile sig_atomic_t alarm_rang; -volatile sig_atomic_t return_requested; -unsigned short wrows; /* Current number of tty rows. */ -int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; -int xflag = 0, zflag = 0; +static struct statinfo cur, last; +static int num_devices; +static struct device_selection *dev_select; +static int maxshowdevs; +static volatile sig_atomic_t headercount; +static volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static volatile sig_atomic_t alarm_rang; +static volatile sig_atomic_t return_requested; +static unsigned short wrows; /* Current number of tty rows. */ +static int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; +static int xflag = 0, zflag = 0; /* local function declarations */ static void usage(void); @@ -650,7 +654,7 @@ main(int argc, char **argv) * Force a header to be prepended to the next output. */ void -needhdr(int signo) +needhdr(int signo __unused) { headercount = 1; @@ -662,7 +666,7 @@ needhdr(int signo) * prepended to the next output. */ void -needresize(int signo) +needresize(int signo __unused) { wresized = 1; @@ -673,7 +677,7 @@ needresize(int signo) * Record the alarm so the main loop can break its sleep */ void -alarm_clock(int signo) +alarm_clock(int signo __unused) { alarm_rang = 1; } @@ -682,7 +686,7 @@ alarm_clock(int signo) * Request that the main loop exit soon */ void -needreturn(int signo) +needreturn(int signo __unused) { return_requested = 1; } @@ -998,8 +1002,7 @@ readvar(kvm_t *kd, const char *name, int nlid, void *ptr, size_t len) warnx("kvm_read(%s): %s", namelist[nlid].n_name, kvm_geterr(kd)); return (1); - } - if (nbytes != len) { + } else if ((size_t)nbytes != len) { warnx("kvm_read(%s): expected %zu bytes, got %zd bytes", namelist[nlid].n_name, len, nbytes); return (1); diff --git a/usr.sbin/pciconf/Makefile b/usr.sbin/pciconf/Makefile index a839733..e288654 100644 --- a/usr.sbin/pciconf/Makefile +++ b/usr.sbin/pciconf/Makefile @@ -5,6 +5,4 @@ PROG= pciconf SRCS= pciconf.c cap.c err.c MAN= pciconf.8 -WARNS?= 3 - .include <bsd.prog.mk> diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index 9ab6dd1..966ef9a0 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -117,7 +117,7 @@ cap_agp(int fd, struct pci_conf *p, uint8_t ptr) } static void -cap_vpd(int fd, struct pci_conf *p, uint8_t ptr) +cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused) { printf("VPD"); @@ -172,6 +172,7 @@ cap_pcix(int fd, struct pci_conf *p, uint8_t ptr) } if ((p->pc_hdr & PCIM_HDRTYPE) == 1) return; + max_burst_read = 0; switch (status & PCIXM_STATUS_MAX_READ) { case PCIXM_STATUS_MAX_READ_512: max_burst_read = 512; @@ -186,6 +187,7 @@ cap_pcix(int fd, struct pci_conf *p, uint8_t ptr) max_burst_read = 4096; break; } + max_splits = 0; switch (status & PCIXM_STATUS_MAX_SPLITS) { case PCIXM_STATUS_MAX_SPLITS_1: max_splits = 1; @@ -515,7 +517,7 @@ cap_msix(int fd, struct pci_conf *p, uint8_t ptr) } static void -cap_sata(int fd, struct pci_conf *p, uint8_t ptr) +cap_sata(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused) { printf("SATA Index-Data Pair"); @@ -759,7 +761,7 @@ ecap_sriov(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) print_bar(fd, p, "iov bar ", ptr + PCIR_SRIOV_BAR(i)); } -struct { +static struct { uint16_t id; const char *name; } ecap_names[] = { diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 194da6b..d62ce77 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -67,7 +67,7 @@ struct pci_vendor_info char *desc; }; -TAILQ_HEAD(,pci_vendor_info) pci_vendors; +static TAILQ_HEAD(,pci_vendor_info) pci_vendors; static struct pcisel getsel(const char *str); static void list_bridge(int fd, struct pci_conf *p); @@ -896,40 +896,39 @@ getdevice(const char *name) static struct pcisel parsesel(const char *str) { - char *ep = strchr(str, '@'); - char *epbase; + const char *ep; + char *eppos; struct pcisel sel; unsigned long selarr[4]; int i; - if (ep == NULL) - ep = (char *)str; - else + ep = strchr(str, '@'); + if (ep != NULL) ep++; - - epbase = ep; + else + ep = str; if (strncmp(ep, "pci", 3) == 0) { ep += 3; i = 0; - do { - selarr[i++] = strtoul(ep, &ep, 10); - } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); - - if (i > 2) - sel.pc_func = selarr[--i]; - else - sel.pc_func = 0; - sel.pc_dev = selarr[--i]; - sel.pc_bus = selarr[--i]; - if (i > 0) - sel.pc_domain = selarr[--i]; - else - sel.pc_domain = 0; + while (isdigit(*ep) && i < 4) { + selarr[i++] = strtoul(ep, &eppos, 10); + ep = eppos; + if (*ep == ':') { + ep++; + if (*ep == '\0') + i = 0; + } + } + if (i > 0 && *ep == '\0') { + sel.pc_func = (i > 2) ? selarr[--i] : 0; + sel.pc_dev = (i > 0) ? selarr[--i] : 0; + sel.pc_bus = (i > 0) ? selarr[--i] : 0; + sel.pc_domain = (i > 0) ? selarr[--i] : 0; + return (sel); + } } - if (*ep != '\x0' || ep == epbase) - errx(1, "cannot parse selector %s", str); - return sel; + errx(1, "cannot parse selector %s", str); } static struct pcisel diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 1482798..9cfe5c3 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -554,7 +554,7 @@ rtsol_check_timer(void) struct timespec now, rtsol_timer; struct ifinfo *ifi; struct rainfo *rai; - struct ra_opt *rao; + struct ra_opt *rao, *raotmp; int flags; clock_gettime(CLOCK_MONOTONIC_FAST, &now); @@ -649,7 +649,8 @@ rtsol_check_timer(void) int expire = 0; TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next) { - TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) { + TAILQ_FOREACH_SAFE(rao, &rai->rai_ra_opt, + rao_next, raotmp) { warnmsg(LOG_DEBUG, __func__, "RA expiration timer: " "type=%d, msg=%s, expire=%s", |