diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/arp/arp.c | 20 | ||||
-rwxr-xr-x | usr.sbin/crashinfo/crashinfo.sh | 2 | ||||
-rw-r--r-- | usr.sbin/kbdmap/kbdmap.c | 1 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/menus.c | 24 | ||||
-rw-r--r-- | usr.sbin/sysinstall/modules.c | 4 | ||||
-rw-r--r-- | usr.sbin/traceroute/Makefile | 2 |
7 files changed, 31 insertions, 24 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 2ee9d67..59fbea8 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -319,9 +319,15 @@ set(int argc, char **argv) doing_proxy = flags = proxy_only = expire_time = 0; while (argc-- > 0) { if (strncmp(argv[0], "temp", 4) == 0) { - struct timeval tv; - gettimeofday(&tv, 0); - expire_time = tv.tv_sec + 20 * 60; + struct timespec tp; + int max_age; + size_t len = sizeof(max_age); + + clock_gettime(CLOCK_MONOTONIC, &tp); + if (sysctlbyname("net.link.ether.inet.max_age", + &max_age, &len, NULL, 0) != 0) + err(1, "sysctlbyname"); + expire_time = tp.tv_sec + max_age; } else if (strncmp(argv[0], "pub", 3) == 0) { flags |= RTF_ANNOUNCE; doing_proxy = 1; @@ -602,10 +608,10 @@ print_entry(struct sockaddr_dl *sdl, if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { - static struct timeval tv; - if (tv.tv_sec == 0) - gettimeofday(&tv, 0); - if ((expire_time = rtm->rtm_rmx.rmx_expire - tv.tv_sec) > 0) + static struct timespec tp; + if (tp.tv_sec == 0) + clock_gettime(CLOCK_MONOTONIC, &tp); + if ((expire_time = rtm->rtm_rmx.rmx_expire - tp.tv_sec) > 0) printf(" expires in %d seconds", (int)expire_time); else printf(" expired"); diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh index 60f0360..89013a2 100755 --- a/usr.sbin/crashinfo/crashinfo.sh +++ b/usr.sbin/crashinfo/crashinfo.sh @@ -53,7 +53,7 @@ find_kernel() }' $INFO) # Look for a matching kernel version. - for k in /boot/kernel/kernel $(ls -t /boot/*/kernel); do + for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do kvers=$(echo 'printf " Version String: %s", version' | \ gdb -x /dev/stdin -batch $k 2>/dev/null) if [ "$ivers" = "$kvers" ]; then diff --git a/usr.sbin/kbdmap/kbdmap.c b/usr.sbin/kbdmap/kbdmap.c index 474553d..cb00c6d 100644 --- a/usr.sbin/kbdmap/kbdmap.c +++ b/usr.sbin/kbdmap/kbdmap.c @@ -229,6 +229,7 @@ get_font(void) } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); + fclose(fp); return fnt; } diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 0cc7922..6fa34f2 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -91,7 +91,7 @@ static struct _devname { DISK("ipsd%d", "IBM ServeRAID RAID array", 4), DISK("mfid%d", "LSI MegaRAID SAS array", 4), FLOPPY("fd%d", "floppy drive unit A", 4), - SERIAL("cuad%d", "%s on device %s (COM%d)", 16), + SERIAL("cuau%d", "%s on device %s (COM%d)", 16), USB("da%da", "USB Mass Storage Device", 16), NETWORK("ae", "Attansic/Atheros L2 Fast Ethernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 43c57ac..2c669e8 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -426,10 +426,10 @@ DMenu MenuMousePort = { { { "1 BusMouse", "PC-98x1 bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, - { "2 COM1", "Serial mouse on COM1 (/dev/cuad0)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad0" }, - { "3 COM2", "Serial mouse on COM2 (/dev/cuad1)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad1" }, + { "2 COM1", "Serial mouse on COM1 (/dev/cuau0)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau0" }, + { "3 COM2", "Serial mouse on COM2 (/dev/cuau1)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau1" }, { NULL } }, }; #else @@ -442,14 +442,14 @@ DMenu MenuMousePort = { NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, - { "2 COM1", "Serial mouse on COM1 (/dev/cuad0)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad0" }, - { "3 COM2", "Serial mouse on COM2 (/dev/cuad1)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad1" }, - { "4 COM3", "Serial mouse on COM3 (/dev/cuad2)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad2" }, - { "5 COM4", "Serial mouse on COM4 (/dev/cuad3)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad3" }, + { "2 COM1", "Serial mouse on COM1 (/dev/cuau0)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau0" }, + { "3 COM2", "Serial mouse on COM2 (/dev/cuau1)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau1" }, + { "4 COM3", "Serial mouse on COM3 (/dev/cuau2)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau2" }, + { "5 COM4", "Serial mouse on COM4 (/dev/cuau3)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, diff --git a/usr.sbin/sysinstall/modules.c b/usr.sbin/sysinstall/modules.c index 211c51e..e9bdb0f 100644 --- a/usr.sbin/sysinstall/modules.c +++ b/usr.sbin/sysinstall/modules.c @@ -123,13 +123,14 @@ driverFloppyCheck(void) int kldBrowser(dialogMenuItem *self) { - DMenu *menu; + DMenu *menu = NULL; int i, what = DITEM_SUCCESS, msize, count; DIR *dir; struct dirent *de; char *err; err = NULL; + count = 0; if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { err = "Unable to set media device to floppy."; @@ -142,7 +143,6 @@ kldBrowser(dialogMenuItem *self) } msize = sizeof(DMenu) + (sizeof(dialogMenuItem) * 2); - count = 0; if ((menu = malloc(msize)) == NULL) { err = "Failed to allocate memory for menu"; goto errout; diff --git a/usr.sbin/traceroute/Makefile b/usr.sbin/traceroute/Makefile index 6d6752a..c77244f 100644 --- a/usr.sbin/traceroute/Makefile +++ b/usr.sbin/traceroute/Makefile @@ -29,7 +29,7 @@ DPADD= ${LIBIPSEC} LDADD= -lipsec .endif -CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl -I${TRACEROUTE_DISTDIR} +CFLAGS+= -I${TRACEROUTE_DISTDIR} WARNS?= 0 |