This fixes the build of shells/nsh after the n2k14 network header changes. While there, I belatedly corrected a number of type mismatches due to the time_t change.
ok? Index: Makefile =================================================================== RCS file: /cvs/ports/shells/nsh/Makefile,v retrieving revision 1.6 diff -u -p -r1.6 Makefile --- Makefile 27 Nov 2013 14:14:22 -0000 1.6 +++ Makefile 28 Jan 2014 20:21:02 -0000 @@ -3,7 +3,7 @@ COMMENT = network switch style shell DISTNAME = nsh-1.0 -REVISION = 2 +REVISION = 3 CATEGORIES = shells net HOMEPAGE = http://www.nmedia.net/nsh/ Index: patches/patch-if_c =================================================================== RCS file: /cvs/ports/shells/nsh/patches/patch-if_c,v retrieving revision 1.3 diff -u -p -r1.3 patch-if_c --- patches/patch-if_c 27 Nov 2013 14:14:22 -0000 1.3 +++ patches/patch-if_c 28 Jan 2014 20:21:03 -0000 @@ -1,7 +1,16 @@ $OpenBSD: patch-if_c,v 1.3 2013/11/27 14:14:22 jca Exp $ ---- if.c.orig Tue Nov 26 16:31:55 2013 -+++ if.c Tue Nov 26 17:06:12 2013 -@@ -170,9 +170,9 @@ show_int(int argc, char **argv) +--- if.c.orig Sun Feb 10 19:36:49 2013 ++++ if.c Tue Jan 28 21:14:25 2014 +@@ -103,7 +103,7 @@ show_int(int argc, char **argv) + struct vlanreq vreq; + + short tmp; +- int ifs, br, flags, days, hours, mins, pntd; ++ int ifs, br, flags, days, hours, mins, secs, pntd; + int ippntd = 0; + int buf3; + time_t c; +@@ -170,25 +170,26 @@ show_int(int argc, char **argv) printf(" %s is %s", br ? "Bridge" : "Interface", flags & IFF_UP ? "up" : "down"); @@ -13,7 +22,17 @@ $OpenBSD: patch-if_c,v 1.3 2013/11/27 14 days = c / SECSPERDAY; c %= SECSPERDAY; hours = c / SECSPERHOUR; -@@ -188,7 +188,7 @@ show_int(int argc, char **argv) + c %= SECSPERHOUR; + mins = c / SECSPERMIN; + c %= SECSPERMIN; ++ secs = c; + printf(" (last change "); + if (days) + printf("%id ", days); +- printf("%02i:%02i:%02i)", hours, mins, c); ++ printf("%02i:%02i:%02i)", hours, mins, secs); + } + printf(", protocol is %s", flags & IFF_RUNNING ? "up" : "down"); printf("\n"); @@ -22,7 +41,7 @@ $OpenBSD: patch-if_c,v 1.3 2013/11/27 14 printf(" Interface type %s", type); if (flags & IFF_BROADCAST) -@@ -305,16 +305,17 @@ show_int(int argc, char **argv) +@@ -305,16 +306,17 @@ show_int(int argc, char **argv) /* * Display MTU, line rate */ @@ -45,7 +64,7 @@ $OpenBSD: patch-if_c,v 1.3 2013/11/27 14 else printf("\n"); -@@ -342,25 +343,30 @@ show_int(int argc, char **argv) +@@ -342,25 +344,30 @@ show_int(int argc, char **argv) * Display remaining info from if_data structure */ printf(" %qu packets input, %qu bytes, %qu errors, %qu drops\n", @@ -83,7 +102,7 @@ $OpenBSD: patch-if_c,v 1.3 2013/11/27 14 /* * These appear to be the only interface types to increase collision * count in the OpenBSD 3.2 kernel. -@@ -369,7 +375,7 @@ show_int(int argc, char **argv) +@@ -369,7 +376,7 @@ show_int(int argc, char **argv) case IFT_SLIP: case IFT_PROPVIRTUAL: case IFT_IEEE80211: @@ -92,7 +111,7 @@ $OpenBSD: patch-if_c,v 1.3 2013/11/27 14 break; default: break; -@@ -524,9 +530,9 @@ get_ifdata(char *ifname, int type) +@@ -524,9 +531,9 @@ get_ifdata(char *ifname, int type) ifr.ifr_data = (caddr_t)&if_data; if (ioctl(ifs, SIOCGIFDATA, (caddr_t)&ifr) == 0) { if (type == IFDATA_MTU) Index: patches/patch-kroute_c =================================================================== RCS file: patches/patch-kroute_c diff -N patches/patch-kroute_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-kroute_c 28 Jan 2014 20:21:03 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- kroute.c.orig Sun Feb 10 19:36:49 2013 ++++ kroute.c Tue Jan 28 20:59:30 2014 +@@ -479,7 +479,7 @@ print_getmsg(rtm, msglen) + printf("\thopcount:\t%u\n", rtm->rtm_rmx.rmx_hopcount); + if (rtm->rtm_rmx.rmx_expire) { + rtm->rtm_rmx.rmx_expire -= time(0); +- printf("\texpires:\t%u sec\n", rtm->rtm_rmx.rmx_expire); ++ printf("\texpires:\t%lld sec\n", rtm->rtm_rmx.rmx_expire); + } + + #define RTA_IGN (RTA_DST|RTA_GATEWAY|RTA_NETMASK|RTA_IFP|RTA_IFA|RTA_BRD) Index: patches/patch-stats_c =================================================================== RCS file: patches/patch-stats_c diff -N patches/patch-stats_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-stats_c 28 Jan 2014 20:21:03 -0000 @@ -0,0 +1,43 @@ +$OpenBSD$ +--- stats.c.orig Sun Feb 10 19:36:49 2013 ++++ stats.c Tue Jan 28 20:07:06 2014 +@@ -132,7 +132,7 @@ tcp_stats() + p(tcps_sndprobe, "\t\t%u window probe packet%s\n"); + p(tcps_sndwinup, "\t\t%u window update packet%s\n"); + p(tcps_sndctrl, "\t\t%u control packet%s\n"); +- p(tcps_outhwcsum, "\t\t%u packet%s hardware-checksummed\n"); ++ p(tcps_outswcsum, "\t\t%u packet%s software-checksummed\n"); + p(tcps_rcvtotal, "\t%u packet%s received\n"); + p2(tcps_rcvackpack, tcps_rcvackbyte, "\t\t%u ack%s (for %qd byte%s)\n"); + p(tcps_rcvdupack, "\t\t%u duplicate ack%s\n"); +@@ -157,7 +157,7 @@ tcp_stats() + p1(tcps_rcvshort, "\t\t%u discarded because packet too short\n"); + p1(tcps_rcvnosec, "\t\t%u discarded for missing IPsec protection\n"); + p1(tcps_rcvmemdrop, "\t\t%u discarded due to memory shortage\n"); +- p(tcps_inhwcsum, "\t\t%u packet%s hardware-checksummed\n"); ++ p(tcps_inswcsum, "\t\t%u packet%s software-checksummed\n"); + p(tcps_rcvbadsig, "\t\t%u bad/missing md5 checksum%s\n"); + p(tcps_rcvgoodsig, "\t\t%qd good md5 checksum%s\n"); + p(tcps_connattempt, "\t%u connection request%s\n"); +@@ -249,8 +249,8 @@ udp_stats() + p1(udps_badlen, "\t%lu with bad data length field\n"); + p1(udps_badsum, "\t%lu with bad checksum\n"); + p1(udps_nosum, "\t%lu with no checksum\n"); +- p(udps_inhwcsum, "\t%lu input packet%s hardware-checksummed\n"); +- p(udps_outhwcsum, "\t%lu output packet%s hardware-checksummed\n"); ++ p(udps_inswcsum, "\t%lu input packet%s software-checksummed\n"); ++ p(udps_outswcsum, "\t%lu output packet%s software-checksummed\n"); + p1(udps_noport, "\t%lu dropped due to no socket\n"); + p(udps_noportbcast, "\t%lu broadcast/multicast datagram%s dropped due to no socket\n"); + p1(udps_nosec, "\t%lu dropped due to missing IPsec protection\n"); +@@ -323,8 +323,8 @@ ip_stats() + p(ips_toolong, "\t%lu packet%s with ip length > max ip packet size\n"); + p(ips_nogif, "\t%lu tunneling packet%s that can't find gif\n"); + p(ips_badaddr, "\t%lu datagram%s with bad address in header\n"); +- p(ips_inhwcsum, "\t%lu input datagram%s checksum-processed by hardware\n"); +- p(ips_outhwcsum, "\t%lu output datagram%s checksum-processed by hardware\n"); ++ p(ips_inswcsum, "\t%lu input datagram%s software-checksummed\n"); ++ p(ips_outswcsum, "\t%lu output datagram%s software-checksummed\n"); + p(ips_notmember, "\t%lu multicast packet%s which we don't join\n"); + #undef p + #undef p1 Index: patches/patch-utils_c =================================================================== RCS file: patches/patch-utils_c diff -N patches/patch-utils_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-utils_c 28 Jan 2014 20:21:03 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ +--- utils.c.orig Sun Feb 10 19:36:49 2013 ++++ utils.c Tue Jan 28 21:17:43 2014 +@@ -88,8 +88,8 @@ format_time(time_t seconds) + } else { + /* standard method produces MMM:SS */ + /* we avoid printf as must as possible to make this quick */ +- snprintf(result, sizeof(result), "%3d:%02d", seconds / 60, +- seconds % 60); ++ snprintf(result, sizeof(result), "%3d:%02d", (int)seconds / 60, ++ (int)seconds % 60); + } + return (result); + } Index: patches/patch-version_c =================================================================== RCS file: patches/patch-version_c diff -N patches/patch-version_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-version_c 28 Jan 2014 20:21:03 -0000 @@ -0,0 +1,29 @@ +$OpenBSD$ +--- version.c.orig Sun Feb 10 19:36:49 2013 ++++ version.c Tue Jan 28 21:15:41 2014 +@@ -38,7 +38,7 @@ version(int argc, char **argv) + size_t len; + time_t c; + uint64_t physmem; +- int mib[5], ipdrops, mplsdrops, pntd, weeks, days, hours, mins; ++ int mib[5], ipdrops, mplsdrops, pntd, weeks, days, hours, mins, secs; + + mib[0] = CTL_HW; + mib[1] = HW_PHYSMEM64; +@@ -107,6 +107,7 @@ version(int argc, char **argv) + c %= SECSPERHOUR; + mins = c / SECSPERMIN; + c %= SECSPERMIN; ++ secs = c; + if (weeks) { + printf("%d week%s", weeks, weeks == 1 ? "" : "s"); + pntd = 1; +@@ -127,7 +128,7 @@ version(int argc, char **argv) + pntd = 1; + } + if (!pntd) +- printf("%d second%s", c, c == 1 ? "" : "s"); ++ printf("%d second%s", secs, secs == 1 ? "" : "s"); + printf("\n"); + printf("system: %s/%s version %s\n", un.sysname, un.machine, + un.release); Index: patches/patch-who_c =================================================================== RCS file: patches/patch-who_c diff -N patches/patch-who_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-who_c 28 Jan 2014 20:21:03 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ +--- who.c.orig Sun Feb 10 19:36:49 2013 ++++ who.c Tue Jan 28 21:17:17 2014 +@@ -114,8 +114,8 @@ output(struct utmp *up) + (void)printf("00:00 "); + else if (idle < (24 * 60 * 60)) + (void)printf("%02d:%02d ", +- (idle / (60 * 60)), +- (idle % (60 * 60)) / 60); ++ ((int)idle / (60 * 60)), ++ ((int)idle % (60 * 60)) / 60); + else + (void)printf(" old "); + -- Christian "naddy" Weisgerber na...@mips.inka.de