CVS commit: src/external/gpl3/gcc
Module Name:src Committed By: mrg Date: Fri Feb 7 07:16:32 UTC 2020 Modified Files: src/external/gpl3/gcc: README.gcc8 Log Message: powerpc switched. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/README.gcc8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/README.gcc8 diff -u src/external/gpl3/gcc/README.gcc8:1.6 src/external/gpl3/gcc/README.gcc8:1.7 --- src/external/gpl3/gcc/README.gcc8:1.6 Thu Nov 28 19:31:27 2019 +++ src/external/gpl3/gcc/README.gcc8 Fri Feb 7 07:16:32 2020 @@ -1,4 +1,4 @@ -$NetBSD: README.gcc8,v 1.6 2019/11/28 19:31:27 mrg Exp $ +$NetBSD: README.gcc8,v 1.7 2020/02/07 07:16:32 mrg Exp $ new stuff: cc1objcplus @@ -51,9 +51,9 @@ mipseb y y y y ? ? ? ? mipsel y ? y y ? ? ? ? mips64eb y y y y y y y[2] ? mips64el y ? y y ? ? ? ? -powerpc y y y y y y y[1] ? +powerpc y y y y y y y[1] y powerpc64 y n y y y y y y -sh3eb y y y y y y yX ? +sh3eb y y y y y y y ? sh3el y y y y y ? ? ? sparc y y y y y y y y sparc64 y y y y y y y y
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Fri Feb 7 02:06:13 UTC 2020 Modified Files: src/bin/sh: jobs.c Log Message: Avoid a core dump if a child process that is not one of our children happens to exit while we are waiting for another child to exit. This can happen with code like sh -c ' sleep 5 & exec sh -c "sleep 10 & wait !$" ' when the inner "sh" is waiting for the 10 second sleep to be done, the 5 second sleep started earlier terminates. It is a child of our process, as the inner shell is the same process as the outer one, but not a known child (the inner shell has no idea what the outer one did before it started). This was observed in the wild by Martijn Dekker (where the outer shell was bash but that's irrelevant). XXX pullup -9 To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/bin/sh/jobs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/jobs.c diff -u src/bin/sh/jobs.c:1.106 src/bin/sh/jobs.c:1.107 --- src/bin/sh/jobs.c:1.106 Tue Mar 26 13:32:26 2019 +++ src/bin/sh/jobs.c Fri Feb 7 02:06:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.106 2019/03/26 13:32:26 kre Exp $ */ +/* $NetBSD: jobs.c,v 1.107 2020/02/07 02:06:12 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: jobs.c,v 1.106 2019/03/26 13:32:26 kre Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.107 2020/02/07 02:06:12 kre Exp $"); #endif #endif /* not lint */ @@ -820,6 +820,9 @@ waitcmd(int argc, char **argv) if ((i = dowait(WBLOCK|WNOFREE, NULL, &job)) == -1) return 128 + lastsig(); + if (job == NULL) /* an interloper */ +continue; + /* * one of the job's processes exited, * but there are more
CVS commit: src/bin/sh
Module Name:src Committed By: fox Date: Fri Feb 7 01:25:08 UTC 2020 Modified Files: src/bin/sh: main.c Log Message: bin/sh: Fixes -Werror=shadow causing build breaks. Conflicting variable name, sigset_t sigs has been renamed to sigset_t mask Reviewed by: kamil@ To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/bin/sh/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/main.c diff -u src/bin/sh/main.c:1.84 src/bin/sh/main.c:1.85 --- src/bin/sh/main.c:1.84 Thu Feb 6 20:08:28 2020 +++ src/bin/sh/main.c Fri Feb 7 01:25:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.84 2020/02/06 20:08:28 kre Exp $ */ +/* $NetBSD: main.c,v 1.85 2020/02/07 01:25:08 fox Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19 #if 0 static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95"; #else -__RCSID("$NetBSD: main.c,v 1.84 2020/02/06 20:08:28 kre Exp $"); +__RCSID("$NetBSD: main.c,v 1.85 2020/02/07 01:25:08 fox Exp $"); #endif #endif /* not lint */ @@ -108,7 +108,7 @@ main(int argc, char **argv) char *shinit; uid_t uid; gid_t gid; - sigset_t sigs; + sigset_t mask; /* * If we happen to be invoked with SIGCHLD ignored, we cannot @@ -121,9 +121,9 @@ main(int argc, char **argv) /* * Similarly, SIGCHLD must not be blocked */ - sigemptyset(&sigs); - sigaddset(&sigs, SIGCHLD); - sigprocmask(SIG_UNBLOCK, &sigs, NULL); + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + sigprocmask(SIG_UNBLOCK, &mask, NULL); uid = getuid(); gid = getgid();
CVS commit: src/sys/dev/ic
Module Name:src Committed By: thorpej Date: Fri Feb 7 01:19:46 UTC 2020 Modified Files: src/sys/dev/ic: elink3.c Log Message: Use callout_setfunc() / callout_schedule(). To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.152 src/sys/dev/ic/elink3.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/elink3.c diff -u src/sys/dev/ic/elink3.c:1.151 src/sys/dev/ic/elink3.c:1.152 --- src/sys/dev/ic/elink3.c:1.151 Tue Feb 4 05:25:39 2020 +++ src/sys/dev/ic/elink3.c Fri Feb 7 01:19:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: elink3.c,v 1.151 2020/02/04 05:25:39 thorpej Exp $ */ +/* $NetBSD: elink3.c,v 1.152 2020/02/07 01:19:46 thorpej Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.151 2020/02/04 05:25:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.152 2020/02/07 01:19:46 thorpej Exp $"); #include "opt_inet.h" @@ -324,7 +324,10 @@ epconfig(struct ep_softc *sc, u_short ch u_int8_t myla[ETHER_ADDR_LEN]; callout_init(&sc->sc_mii_callout, 0); + callout_setfunc(&sc->sc_mii_callout, ep_tick, sc); + callout_init(&sc->sc_mbuf_callout, 0); + callout_setfunc(&sc->sc_mbuf_callout, epmbuffill, sc); sc->ep_chipset = chipset; @@ -708,7 +711,7 @@ ep_tick(void *arg) mii_tick(&sc->sc_mii); splx(s); - callout_reset(&sc->sc_mii_callout, hz, ep_tick, sc); + callout_schedule(&sc->sc_mii_callout, hz); } /* @@ -830,7 +833,7 @@ epinit(struct ifnet *ifp) if (sc->ep_flags & ELINK_FLAGS_MII) { /* Start the one second clock. */ - callout_reset(&sc->sc_mii_callout, hz, ep_tick, sc); + callout_schedule(&sc->sc_mii_callout, hz); } /* Attempt to start output, if any. */ @@ -1547,7 +1550,7 @@ epget(struct ep_softc *sc, int totlen) } else { /* If the queue is no longer full, refill. */ if (sc->last_mb == sc->next_mb) - callout_reset(&sc->sc_mbuf_callout, 1, epmbuffill, sc); + callout_schedule(&sc->sc_mbuf_callout, 1); /* Convert one of our saved mbuf's. */ sc->next_mb = (sc->next_mb + 1) % MAX_MBS; @@ -1915,7 +1918,7 @@ epmbuffill(void *v) sc->last_mb = i; /* If the queue was not filled, try again. */ if (sc->last_mb != sc->next_mb) - callout_reset(&sc->sc_mbuf_callout, 1, epmbuffill, sc); + callout_schedule(&sc->sc_mbuf_callout, 1); splx(s); }
CVS commit: src/sys/net
Module Name:src Committed By: thorpej Date: Fri Feb 7 01:14:55 UTC 2020 Modified Files: src/sys/net: if.c Log Message: IPL_SOFTNET -> IPL_NET in previous. To generate a diff of this commit: cvs rdiff -u -r1.471 -r1.472 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.471 src/sys/net/if.c:1.472 --- src/sys/net/if.c:1.471 Thu Feb 6 23:30:19 2020 +++ src/sys/net/if.c Fri Feb 7 01:14:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.471 2020/02/06 23:30:19 thorpej Exp $ */ +/* $NetBSD: if.c,v 1.472 2020/02/07 01:14:55 thorpej Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.471 2020/02/06 23:30:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.472 2020/02/07 01:14:55 thorpej Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -313,7 +313,7 @@ ifinit1(void) ifnet_psref_class = psref_class_create("ifnet", IPL_SOFTNET); ifa_psref_class = psref_class_create("ifa", IPL_SOFTNET); error = workqueue_create(&ifnet_link_state_wq, "iflnkst", - if_link_state_change_work, NULL, PRI_SOFTNET, IPL_SOFTNET, + if_link_state_change_work, NULL, PRI_SOFTNET, IPL_NET, WQ_MPSAFE); KASSERT(error == 0); PSLIST_INIT(&ifnet_pslist);
CVS commit: src/sys/dev/ic
Module Name:src Committed By: thorpej Date: Fri Feb 7 00:56:49 UTC 2020 Modified Files: src/sys/dev/ic: aic6915.c elinkxl.c gem.c hme.c i82557.c rtl8169.c rtl81x9.c smc83c170.c smc91cxx.c Log Message: Use callout_setfunc() / callout_schedule(). To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/aic6915.c cvs rdiff -u -r1.135 -r1.136 src/sys/dev/ic/elinkxl.c cvs rdiff -u -r1.127 -r1.128 src/sys/dev/ic/gem.c cvs rdiff -u -r1.106 -r1.107 src/sys/dev/ic/hme.c cvs rdiff -u -r1.158 -r1.159 src/sys/dev/ic/i82557.c cvs rdiff -u -r1.163 -r1.164 src/sys/dev/ic/rtl8169.c cvs rdiff -u -r1.109 -r1.110 src/sys/dev/ic/rtl81x9.c cvs rdiff -u -r1.92 -r1.93 src/sys/dev/ic/smc83c170.c cvs rdiff -u -r1.105 -r1.106 src/sys/dev/ic/smc91cxx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/aic6915.c diff -u src/sys/dev/ic/aic6915.c:1.41 src/sys/dev/ic/aic6915.c:1.42 --- src/sys/dev/ic/aic6915.c:1.41 Wed Jan 29 14:09:58 2020 +++ src/sys/dev/ic/aic6915.c Fri Feb 7 00:56:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: aic6915.c,v 1.41 2020/01/29 14:09:58 thorpej Exp $ */ +/* $NetBSD: aic6915.c,v 1.42 2020/02/07 00:56:48 thorpej Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.41 2020/01/29 14:09:58 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.42 2020/02/07 00:56:48 thorpej Exp $"); #include @@ -143,6 +143,7 @@ sf_attach(struct sf_softc *sc) uint8_t enaddr[ETHER_ADDR_LEN]; callout_init(&sc->sc_tick_callout, 0); + callout_setfunc(&sc->sc_tick_callout, sf_tick, sc); /* * If we're I/O mapped, the functional register handle is @@ -823,7 +824,7 @@ sf_tick(void *arg) sf_stats_update(sc); splx(s); - callout_reset(&sc->sc_tick_callout, hz, sf_tick, sc); + callout_schedule(&sc->sc_tick_callout, hz); } /* @@ -1088,7 +1089,7 @@ sf_init(struct ifnet *ifp) GEC_TxDmaEn | GEC_RxDmaEn | GEC_TransmitEn | GEC_ReceiveEn); /* Start the on second clock. */ - callout_reset(&sc->sc_tick_callout, hz, sf_tick, sc); + callout_schedule(&sc->sc_tick_callout, hz); /* * Note that the interface is now running. Index: src/sys/dev/ic/elinkxl.c diff -u src/sys/dev/ic/elinkxl.c:1.135 src/sys/dev/ic/elinkxl.c:1.136 --- src/sys/dev/ic/elinkxl.c:1.135 Tue Feb 4 05:25:39 2020 +++ src/sys/dev/ic/elinkxl.c Fri Feb 7 00:56:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.135 2020/02/04 05:25:39 thorpej Exp $ */ +/* $NetBSD: elinkxl.c,v 1.136 2020/02/07 00:56:48 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.135 2020/02/04 05:25:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.136 2020/02/07 00:56:48 thorpej Exp $"); #include #include @@ -176,6 +176,7 @@ ex_config(struct ex_softc *sc) pmf_self_suspensor_init(sc->sc_dev, &sc->sc_suspensor, &sc->sc_qual); callout_init(&sc->ex_mii_callout, 0); + callout_setfunc(&sc->ex_mii_callout, ex_tick, sc); ex_reset(sc); @@ -688,7 +689,7 @@ ex_init(struct ifnet *ifp) GO_WINDOW(1); - callout_reset(&sc->ex_mii_callout, hz, ex_tick, sc); + callout_schedule(&sc->ex_mii_callout, hz); out: if (error) { @@ -1546,7 +1547,7 @@ ex_tick(void *arg) splx(s); - callout_reset(&sc->ex_mii_callout, hz, ex_tick, sc); + callout_schedule(&sc->ex_mii_callout, hz); } void Index: src/sys/dev/ic/gem.c diff -u src/sys/dev/ic/gem.c:1.127 src/sys/dev/ic/gem.c:1.128 --- src/sys/dev/ic/gem.c:1.127 Tue Feb 4 05:25:39 2020 +++ src/sys/dev/ic/gem.c Fri Feb 7 00:56:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.127 2020/02/04 05:25:39 thorpej Exp $ */ +/* $NetBSD: gem.c,v 1.128 2020/02/07 00:56:48 thorpej Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.127 2020/02/04 05:25:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.128 2020/02/07 00:56:48 thorpej Exp $"); #include "opt_inet.h" @@ -616,6 +616,8 @@ gem_attach(struct gem_softc *sc, const u #endif callout_init(&sc->sc_tick_ch, 0); + callout_setfunc(&sc->sc_tick_ch, gem_tick, sc); + callout_init(&sc->sc_rx_watchdog, 0); callout_setfunc(&sc->sc_rx_watchdog, gem_rx_watchdog, sc); @@ -641,7 +643,7 @@ gem_tick(void *arg) s = splnet(); mii_tick(&sc->sc_mii); splx(s); - callout_reset(&sc->sc_tick_ch, hz, gem_tick, sc); + callout_schedule(&sc->sc_tick_ch, hz); } } @@ -1062,7 +1064,7 @@ gem_pcs_start(struct gem_softc *sc) gem_bitwait(sc, h, GEM_MII_STATUS, 0, GEM_MII_STATUS_ANEG_CPT); /* Start the 10 second timer */ - callout_reset(&sc->sc_tick_ch, hz * 10, gem_tick, sc); + callout_schedule(&sc->sc_tick_ch, hz * 10); } /* @@ -1221,7 +1223,7 @@ gem_init(struct ifnet *ifp) gem_pcs_start(sc); else /* Start the one second timer. */ - callout_reset(&
CVS commit: src/sys/arch/arm/acpi
Module Name:src Committed By: jmcneill Date: Fri Feb 7 00:35:00 UTC 2020 Modified Files: src/sys/arch/arm/acpi: acpi_iort.c Log Message: Single mappings are translated to OutputBase, not InputBase To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/acpi_iort.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/acpi/acpi_iort.c diff -u src/sys/arch/arm/acpi/acpi_iort.c:1.1 src/sys/arch/arm/acpi/acpi_iort.c:1.2 --- src/sys/arch/arm/acpi/acpi_iort.c:1.1 Sat Dec 8 15:04:40 2018 +++ src/sys/arch/arm/acpi/acpi_iort.c Fri Feb 7 00:35:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_iort.c,v 1.1 2018/12/08 15:04:40 jmcneill Exp $ */ +/* $NetBSD: acpi_iort.c,v 1.2 2020/02/07 00:35:00 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_iort.c,v 1.1 2018/12/08 15:04:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_iort.c,v 1.2 2020/02/07 00:35:00 jmcneill Exp $"); #include #include @@ -51,7 +51,7 @@ acpi_iort_id_map(ACPI_IORT_NODE *node, u for (n = 0; n < node->MappingCount; n++) { map = ACPI_ADD_PTR(ACPI_IORT_ID_MAPPING, node, offset); if (map->Flags & ACPI_IORT_ID_SINGLE_MAPPING) { - *id = map->InputBase; + *id = map->OutputBase; return map; } if (*id >= map->InputBase && *id <= map->InputBase + map->IdCount) {
CVS commit: src/sys/dev/pci
Module Name:src Committed By: thorpej Date: Fri Feb 7 00:04:28 UTC 2020 Modified Files: src/sys/dev/pci: if_bce.c if_bge.c if_bnx.c if_cas.c if_ena.c if_jme.c if_pcn.c if_sip.c if_ste.c if_stge.c if_vr.c if_vte.c Log Message: Use callout_setfunc() / callout_schedule(). To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/if_bce.c cvs rdiff -u -r1.344 -r1.345 src/sys/dev/pci/if_bge.c cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_bnx.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_cas.c cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_ena.c cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/if_jme.c cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/if_pcn.c cvs rdiff -u -r1.177 -r1.178 src/sys/dev/pci/if_sip.c cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/if_ste.c cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/if_stge.c cvs rdiff -u -r1.132 -r1.133 src/sys/dev/pci/if_vr.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/if_vte.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bce.c diff -u src/sys/dev/pci/if_bce.c:1.57 src/sys/dev/pci/if_bce.c:1.58 --- src/sys/dev/pci/if_bce.c:1.57 Thu Jan 30 13:56:48 2020 +++ src/sys/dev/pci/if_bce.c Fri Feb 7 00:04:28 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bce.c,v 1.57 2020/01/30 13:56:48 thorpej Exp $ */ +/* $NetBSD: if_bce.c,v 1.58 2020/02/07 00:04:28 thorpej Exp $ */ /* * Copyright (c) 2003 Clifford Wright. All rights reserved. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.57 2020/01/30 13:56:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.58 2020/02/07 00:04:28 thorpej Exp $"); #include "vlan.h" @@ -475,6 +475,7 @@ bce_attach(device_t parent, device_t sel rnd_attach_source(&sc->rnd_source, device_xname(self), RND_TYPE_NET, RND_FLAG_DEFAULT); callout_init(&sc->bce_timeout, 0); + callout_setfunc(&sc->bce_timeout, bce_tick, sc); if (pmf_device_register(self, NULL, bce_resume)) pmf_class_network_register(self, ifp); @@ -998,7 +999,7 @@ bce_init(struct ifnet *ifp) BCE_ENET_CTL) | EC_EE); /* start timer */ - callout_reset(&sc->bce_timeout, hz, bce_tick, sc); + callout_schedule(&sc->bce_timeout, hz); /* mark as running, and no outputs active */ ifp->if_flags |= IFF_RUNNING; @@ -1487,5 +1488,5 @@ bce_tick(void *v) mii_tick(&sc->bce_mii); splx(s); - callout_reset(&sc->bce_timeout, hz, bce_tick, sc); + callout_schedule(&sc->bce_timeout, hz); } Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.344 src/sys/dev/pci/if_bge.c:1.345 --- src/sys/dev/pci/if_bge.c:1.344 Tue Feb 4 05:44:14 2020 +++ src/sys/dev/pci/if_bge.c Fri Feb 7 00:04:28 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.344 2020/02/04 05:44:14 thorpej Exp $ */ +/* $NetBSD: if_bge.c,v 1.345 2020/02/07 00:04:28 thorpej Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.344 2020/02/04 05:44:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.345 2020/02/07 00:04:28 thorpej Exp $"); #include #include @@ -4010,6 +4010,7 @@ again: #endif /* BGE_EVENT_COUNTERS */ DPRINTFN(5, ("callout_init\n")); callout_init(&sc->bge_timeout, 0); + callout_setfunc(&sc->bge_timeout, bge_tick, sc); if (pmf_device_register(self, NULL, NULL)) pmf_class_network_register(self, ifp); @@ -4802,7 +4803,7 @@ bge_tick(void *xsc) bge_asf_driver_up(sc); if (!sc->bge_detaching) - callout_reset(&sc->bge_timeout, hz, bge_tick, sc); + callout_schedule(&sc->bge_timeout, hz); splx(s); } @@ -5693,7 +5694,7 @@ bge_init(struct ifnet *ifp) ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; - callout_reset(&sc->bge_timeout, hz, bge_tick, sc); + callout_schedule(&sc->bge_timeout, hz); out: sc->bge_if_flags = ifp->if_flags; Index: src/sys/dev/pci/if_bnx.c diff -u src/sys/dev/pci/if_bnx.c:1.91 src/sys/dev/pci/if_bnx.c:1.92 --- src/sys/dev/pci/if_bnx.c:1.91 Tue Feb 4 05:44:14 2020 +++ src/sys/dev/pci/if_bnx.c Fri Feb 7 00:04:28 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bnx.c,v 1.91 2020/02/04 05:44:14 thorpej Exp $ */ +/* $NetBSD: if_bnx.c,v 1.92 2020/02/07 00:04:28 thorpej Exp $ */ /* $OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $ */ /*- @@ -35,7 +35,7 @@ #if 0 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $"); #endif -__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.91 2020/02/04 05:44:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.92 2020/02/07 00:04:28 thorpej Exp $"); /* * The following controllers are supported by this driver: @@ -912,6 +912,7 @@ bnx_attach(device_t parent, device_t sel ether_ifattach(ifp, sc->eaddr); callout_init(&sc->bnx_timeout, 0); + callout_setfunc(&sc->bnx_timeout, bnx_tick, sc); /* Hookup IRQ last. */ sc->bnx_intrhand = pci_intr_establish_xname(pc, ih, IPL_NET, bnx_intr, @@
CVS commit: src/sys
Module Name:src Committed By: thorpej Date: Thu Feb 6 23:30:20 UTC 2020 Modified Files: src/sys/net: if.c if.h src/sys/netinet: ip_carp.c Log Message: Perform link state change processing on a work queue, rather than in a softint. To generate a diff of this commit: cvs rdiff -u -r1.470 -r1.471 src/sys/net/if.c cvs rdiff -u -r1.280 -r1.281 src/sys/net/if.h cvs rdiff -u -r1.109 -r1.110 src/sys/netinet/ip_carp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.470 src/sys/net/if.c:1.471 --- src/sys/net/if.c:1.470 Sat Feb 1 12:54:50 2020 +++ src/sys/net/if.c Thu Feb 6 23:30:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.470 2020/02/01 12:54:50 riastradh Exp $ */ +/* $NetBSD: if.c,v 1.471 2020/02/06 23:30:19 thorpej Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.470 2020/02/01 12:54:50 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.471 2020/02/06 23:30:19 thorpej Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -180,6 +180,7 @@ static uint64_t index_gen; kmutex_t ifnet_mtx __cacheline_aligned; static struct psref_class *ifnet_psref_class __read_mostly; static pserialize_t ifnet_psz; +static struct workqueue *ifnet_link_state_wq __read_mostly; static kmutex_t if_clone_mtx; @@ -211,7 +212,7 @@ static int ifconf(u_long, void *); static int if_transmit(struct ifnet *, struct mbuf *); static int if_clone_create(const char *); static int if_clone_destroy(const char *); -static void if_link_state_change_si(void *); +static void if_link_state_change_work(struct work *, void *); static void if_up_locked(struct ifnet *); static void _if_down(struct ifnet *); static void if_down_deactivated(struct ifnet *); @@ -298,6 +299,7 @@ ifinit(void) void ifinit1(void) { + int error __diagused; #ifdef NET_MPSAFE printf("NET_MPSAFE enabled\n"); @@ -310,6 +312,10 @@ ifinit1(void) ifnet_psz = pserialize_create(); ifnet_psref_class = psref_class_create("ifnet", IPL_SOFTNET); ifa_psref_class = psref_class_create("ifa", IPL_SOFTNET); + error = workqueue_create(&ifnet_link_state_wq, "iflnkst", + if_link_state_change_work, NULL, PRI_SOFTNET, IPL_SOFTNET, + WQ_MPSAFE); + KASSERT(error == 0); PSLIST_INIT(&ifnet_pslist); if_indexlim = 8; @@ -717,17 +723,6 @@ if_initialize(ifnet_t *ifp) IF_AFDATA_LOCK_INIT(ifp); - if (if_is_link_state_changeable(ifp)) { - u_int flags = SOFTINT_NET; - flags |= if_is_mpsafe(ifp) ? SOFTINT_MPSAFE : 0; - ifp->if_link_si = softint_establish(flags, - if_link_state_change_si, ifp); - if (ifp->if_link_si == NULL) { - rv = ENOMEM; - goto fail; - } - } - PSLIST_ENTRY_INIT(ifp, if_pslist_entry); PSLIST_INIT(&ifp->if_addr_pslist); psref_target_init(&ifp->if_psref, ifnet_psref_class); @@ -1484,11 +1479,6 @@ restart: IF_AFDATA_LOCK_DESTROY(ifp); - if (if_is_link_state_changeable(ifp)) { - softint_disestablish(ifp->if_link_si); - ifp->if_link_si = NULL; - } - /* * remove packets that came from ifp, from software interrupt queues. */ @@ -2252,7 +2242,7 @@ link_rtrequest(int cmd, struct rtentry * * - if IFEF_MPSAFE is enabled, if_snd isn't used and lock contentions on * ifq_lock don't happen * - if IFEF_MPSAFE is disabled, there is no lock contention on ifq_lock - * because if_snd, if_link_state_change and if_link_state_change_softint + * because if_snd, if_link_state_change and if_link_state_change_process * are all called with KERNEL_LOCK */ #define IF_LINK_STATE_CHANGE_LOCK(ifp) \ @@ -2260,6 +2250,16 @@ link_rtrequest(int cmd, struct rtentry * #define IF_LINK_STATE_CHANGE_UNLOCK(ifp) \ mutex_exit((ifp)->if_snd.ifq_lock) +static void +if_link_state_change_work_schedule(struct ifnet *ifp) +{ + if (ifp->if_link_cansched && !ifp->if_link_scheduled) { + ifp->if_link_scheduled = true; + workqueue_enqueue(ifnet_link_state_wq, &ifp->if_link_work, + NULL); + } +} + /* * Handle a change in the interface link state and * queue notifications. @@ -2328,7 +2328,7 @@ if_link_state_change(struct ifnet *ifp, } else LQ_STORE(ifp->if_link_queue, idx, (uint8_t)link_state); - softint_schedule(ifp->if_link_si); + if_link_state_change_work_schedule(ifp); out: IF_LINK_STATE_CHANGE_UNLOCK(ifp); @@ -2337,8 +2337,8 @@ out: /* * Handle interface link state change notifications. */ -void -if_link_state_change_softint(struct ifnet *ifp, int link_state) +static void +if_link_state_change_process(struct ifnet *ifp, int link_state) { struct domain *dp; int s = splnet(); @@ -2409,32 +2409,34 @@ if_link_state_change_softint(struct ifne * Process the interface link state change queue. */ static void -if_link_state_change_si(void *arg) +if_link_state_change_work(struct work *work, void *arg) { - struct ifn
CVS commit: src/sys/modules/examples
Module Name:src Committed By: kamil Date: Thu Feb 6 22:52:26 UTC 2020 Modified Files: src/sys/modules/examples: README Log Message: Document what does ping_block. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/modules/examples/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/examples/README diff -u src/sys/modules/examples/README:1.10 src/sys/modules/examples/README:1.11 --- src/sys/modules/examples/README:1.10 Wed Feb 5 13:23:42 2020 +++ src/sys/modules/examples/README Thu Feb 6 22:52:25 2020 @@ -1,4 +1,4 @@ - $NetBSD: README,v 1.10 2020/02/05 13:23:42 kamil Exp $ + $NetBSD: README,v 1.11 2020/02/06 22:52:25 kamil Exp $ Kernel Developer's Manual @@ -13,6 +13,7 @@ DESCRIPTION * mapper - basic implementation of mmap * panic_string- shows how panic is being called through a device * ping- basic ioctl(9) + * ping_block - basic ioctl(9) with a block device * properties - handle incoming properties during the module load * readhappy - basic implementation of read(9) with happy numbers * readhappy_mpsafe- demonstrates how to make a module MPSAFE
CVS commit: src/games/battlestar
Module Name:src Committed By: fox Date: Thu Feb 6 22:09:43 UTC 2020 Modified Files: src/games/battlestar: parse.c Log Message: games/battlestar: Replace snprintf(3) with strlcpy(3) for better performance. Reviewed by: kamil@ To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/games/battlestar/parse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/battlestar/parse.c diff -u src/games/battlestar/parse.c:1.16 src/games/battlestar/parse.c:1.17 --- src/games/battlestar/parse.c:1.16 Wed Feb 5 20:11:54 2020 +++ src/games/battlestar/parse.c Thu Feb 6 22:09:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.16 2020/02/05 20:11:54 fox Exp $ */ +/* $NetBSD: parse.c,v 1.17 2020/02/06 22:09:43 fox Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: parse.c,v 1.16 2020/02/05 20:11:54 fox Exp $"); +__RCSID("$NetBSD: parse.c,v 1.17 2020/02/06 22:09:43 fox Exp $"); #endif #endif/* not lint */ @@ -120,7 +120,7 @@ parse(void) for (i = n + 1; i < wordcount; i++) { wordtype[i - 1] = wordtype[i]; wordvalue[i - 1] = wordvalue[i]; -snprintf(words[i - 1], WORDLEN, "%s", words[i]); +strlcpy(words[i - 1], words[i], WORDLEN); } wordcount--; } @@ -140,7 +140,7 @@ parse(void) for (i = n + 1; i < wordcount; i++) { wordtype[i - 1] = wordtype[i]; wordvalue[i - 1] = wordvalue[i]; -snprintf(words[i - 1], WORDLEN, "%s", words[i]); +strlcpy(words[i - 1], words[i], WORDLEN); } wordcount--; } @@ -164,7 +164,7 @@ parse(void) wordtype[n + 1] = wordtype[n - 1]; wordtype[n - 1] = OBJECT; strcpy(tmpword, words[n - 1]); -snprintf(words[n - 1], WORDLEN, "%s", words[n + 1]); +strlcpy(words[n - 1], words[n + 1], WORDLEN); strcpy(words[n + 1], tmpword); flag = 1; } @@ -177,7 +177,7 @@ parse(void) for (i = n + 1; i < wordcount; i++) { wordtype[i - 1] = wordtype[i + 1]; wordvalue[i - 1] = wordvalue[i + 1]; - snprintf(words[i - 1], WORDLEN, "%s", words[i + 1]); + strlcpy(words[i - 1], words[i + 1], WORDLEN); } wordcount--; wordcount--;
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 20:17:04 UTC 2020 Modified Files: src/usr.sbin/sysinst: bsddisklabel.c Log Message: Only a single partition can ever have the "extend" flag (grow to available size). To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/sysinst/bsddisklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/bsddisklabel.c diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.38 src/usr.sbin/sysinst/bsddisklabel.c:1.39 --- src/usr.sbin/sysinst/bsddisklabel.c:1.38 Mon Jan 27 21:21:21 2020 +++ src/usr.sbin/sysinst/bsddisklabel.c Thu Feb 6 20:17:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bsddisklabel.c,v 1.38 2020/01/27 21:21:21 martin Exp $ */ +/* $NetBSD: bsddisklabel.c,v 1.39 2020/02/06 20:17:04 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -666,6 +666,8 @@ set_ptn_size(menudesc *m, void *arg) if (p->flags & PUIFLAG_EXTEND) p->flags &= ~PUIFLAG_EXTEND; if (extend && (p->limit == 0 || p->limit > p->size)) { + for (size_t k = 0; k < pset->num; k++) + pset->infos[k].flags &= ~PUIFLAG_EXTEND; p->flags |= PUIFLAG_EXTEND; if (size == 0) size = align;
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Thu Feb 6 20:08:28 UTC 2020 Modified Files: src/bin/sh: main.c Log Message: Actually, the issue with bash (in previous) is more likely that the SIGCHLD is blocked rather than ignored. We want neither. Make sure SIGCHLD is unblocked as well as SIG_DFL. XXX pullup -9 To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/bin/sh/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/main.c diff -u src/bin/sh/main.c:1.83 src/bin/sh/main.c:1.84 --- src/bin/sh/main.c:1.83 Thu Feb 6 19:51:59 2020 +++ src/bin/sh/main.c Thu Feb 6 20:08:28 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.83 2020/02/06 19:51:59 kre Exp $ */ +/* $NetBSD: main.c,v 1.84 2020/02/06 20:08:28 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19 #if 0 static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95"; #else -__RCSID("$NetBSD: main.c,v 1.83 2020/02/06 19:51:59 kre Exp $"); +__RCSID("$NetBSD: main.c,v 1.84 2020/02/06 20:08:28 kre Exp $"); #endif #endif /* not lint */ @@ -108,6 +108,7 @@ main(int argc, char **argv) char *shinit; uid_t uid; gid_t gid; + sigset_t sigs; /* * If we happen to be invoked with SIGCHLD ignored, we cannot @@ -117,6 +118,12 @@ main(int argc, char **argv) * footpath for someone else to fall into... */ (void)signal(SIGCHLD, SIG_DFL); + /* + * Similarly, SIGCHLD must not be blocked + */ + sigemptyset(&sigs); + sigaddset(&sigs, SIGCHLD); + sigprocmask(SIG_UNBLOCK, &sigs, NULL); uid = getuid(); gid = getgid();
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 19:53:10 UTC 2020 Modified Files: src/usr.sbin/sysinst: txtwalk.c Log Message: Fix copy&pasto in previous - from kre. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/txtwalk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/txtwalk.c diff -u src/usr.sbin/sysinst/txtwalk.c:1.3 src/usr.sbin/sysinst/txtwalk.c:1.4 --- src/usr.sbin/sysinst/txtwalk.c:1.3 Thu Feb 6 16:28:10 2020 +++ src/usr.sbin/sysinst/txtwalk.c Thu Feb 6 19:53:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: txtwalk.c,v 1.3 2020/02/06 16:28:10 martin Exp $ */ +/* $NetBSD: txtwalk.c,v 1.4 2020/02/06 19:53:10 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -243,7 +243,7 @@ finddata(const struct lookfor *item, cha && !isspace((unsigned char)line[len]) && line[len] != fmt[1]) { if (line[len] == '\\' - && line[len] != 0) + && line[len+1] != 0) len++; len++; }
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: riastradh Date: Thu Feb 6 19:52:09 UTC 2020 Modified Files: src/sys/arch/arm/sunxi: sun8i_crypto.c Log Message: Fix previous brainfart. Don't use the uninitialized trng node as the root node -- derp. Instead, use the root node as the root node, and initialize the trng node here. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/sunxi/sun8i_crypto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sun8i_crypto.c diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.11 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.12 --- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.11 Mon Jan 20 16:29:38 2020 +++ src/sys/arch/arm/sunxi/sun8i_crypto.c Thu Feb 6 19:52:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.11 2020/01/20 16:29:38 riastradh Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.12 2020/02/06 19:52:09 riastradh Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.11 2020/01/20 16:29:38 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.12 2020/02/06 19:52:09 riastradh Exp $"); #include #include @@ -1177,7 +1177,7 @@ sun8i_crypto_sysctl_attach(struct sun8i_ } /* hw.sun8icryptoN.rng (`struct', 4096-byte array) */ - sysctl_createv(&cy->cy_log, 0, &cy->cy_trng_node, NULL, + sysctl_createv(&cy->cy_log, 0, &cy->cy_root_node, &cy->cy_trng_node, CTLFLAG_PERMANENT|CTLFLAG_READONLY|CTLFLAG_PRIVATE, CTLTYPE_STRUCT, "rng", SYSCTL_DESCR("Read up to 4096 bytes out of the TRNG"), &sun8i_crypto_sysctl_rng, 0, sc, 0, CTL_CREATE, CTL_EOL);
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Thu Feb 6 19:51:59 UTC 2020 Modified Files: src/bin/sh: main.c Log Message: If we are invoked with SIGCHLD ignored, we fail badly, as we assume that we can always wait(2) for our children, and an ignored SIGCHLD prevents that. Recent versions of bash can be convinced (due to a bug most likely) to invoke us that way. Always return SIGCHLD to SIG_DFL during init - we already prevent scripts from fiddling it. All ash derived shells apparently have this problem (observed by Martijn Dekker, and notified on the bash-bug list). Actual issue diagnosed by Harald van Dijk (same list). To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/bin/sh/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/main.c diff -u src/bin/sh/main.c:1.82 src/bin/sh/main.c:1.83 --- src/bin/sh/main.c:1.82 Sat Feb 9 09:33:20 2019 +++ src/bin/sh/main.c Thu Feb 6 19:51:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.82 2019/02/09 09:33:20 kre Exp $ */ +/* $NetBSD: main.c,v 1.83 2020/02/06 19:51:59 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19 #if 0 static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95"; #else -__RCSID("$NetBSD: main.c,v 1.82 2019/02/09 09:33:20 kre Exp $"); +__RCSID("$NetBSD: main.c,v 1.83 2020/02/06 19:51:59 kre Exp $"); #endif #endif /* not lint */ @@ -109,6 +109,15 @@ main(int argc, char **argv) uid_t uid; gid_t gid; + /* + * If we happen to be invoked with SIGCHLD ignored, we cannot + * successfully do almost anything. Perhaps we should remember + * its state and pass it on ignored to children if it was ignored + * on entry, but that seems like just leaving the shit on the + * footpath for someone else to fall into... + */ + (void)signal(SIGCHLD, SIG_DFL); + uid = getuid(); gid = getgid();
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 19:50:04 UTC 2020 Modified Files: src/usr.sbin/sysinst: upgrade.c Log Message: Make re-install sets also work for an explicit selected root wedge To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/upgrade.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/upgrade.c diff -u src/usr.sbin/sysinst/upgrade.c:1.15 src/usr.sbin/sysinst/upgrade.c:1.16 --- src/usr.sbin/sysinst/upgrade.c:1.15 Thu Feb 6 19:08:38 2020 +++ src/usr.sbin/sysinst/upgrade.c Thu Feb 6 19:50:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: upgrade.c,v 1.15 2020/02/06 19:08:38 martin Exp $ */ +/* $NetBSD: upgrade.c,v 1.16 2020/02/06 19:50:04 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -209,14 +209,9 @@ do_reinstall_sets() if (find_disks(msg_string(MSG_reinstall), !root_is_read_only()) < 0) return; - if (!pm->cur_system) { - if (pm->parts == NULL) { - hit_enter_to_continue(MSG_noroot, NULL); - return; - } - + if (!pm->cur_system && pm->parts != NULL) { install_desc_from_parts(&install, pm->parts); - } else { + } else if (pm->cur_system) { install.cur_system = true; }
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 19:41:57 UTC 2020 Modified Files: src/usr.sbin/sysinst: msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl Log Message: Reformat a query to add an automatically detected swap partition so it fits on narrow screens. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/msg.mi.de cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/msg.mi.en cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/msg.mi.es cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.fr cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/msg.mi.pl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/msg.mi.de diff -u src/usr.sbin/sysinst/msg.mi.de:1.20 src/usr.sbin/sysinst/msg.mi.de:1.21 --- src/usr.sbin/sysinst/msg.mi.de:1.20 Thu Jan 9 13:22:30 2020 +++ src/usr.sbin/sysinst/msg.mi.de Thu Feb 6 19:41:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.de,v 1.20 2020/01/09 13:22:30 martin Exp $ */ +/* $NetBSD: msg.mi.de,v 1.21 2020/02/06 19:41:57 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1260,7 +1260,7 @@ message swap_display {Auslagerungspartit * $1 = swap partition name my_swap */ message Auto_add_swap_part -{Eine Auslagerungspartition (mit Namen $1) +{Eine Auslagerungspartition (mit Namen $1) scheint bereits auf der Festplatte $0 zu existieren. Möchten Sie diese benutzen?} Index: src/usr.sbin/sysinst/msg.mi.en diff -u src/usr.sbin/sysinst/msg.mi.en:1.27 src/usr.sbin/sysinst/msg.mi.en:1.28 --- src/usr.sbin/sysinst/msg.mi.en:1.27 Thu Jan 9 13:22:30 2020 +++ src/usr.sbin/sysinst/msg.mi.en Thu Feb 6 19:41:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.en,v 1.27 2020/01/09 13:22:30 martin Exp $ */ +/* $NetBSD: msg.mi.en,v 1.28 2020/02/06 19:41:57 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1190,7 +1190,8 @@ message swap_display {swap} * $1 = swap partition name my_swap */ message Auto_add_swap_part -{A swap partition (named $1) seems to exist on $0. +{A swap partition (named $1) +seems to exist on $0. Do you want to use that?} message parttype_disklabel {BSD disklabel} Index: src/usr.sbin/sysinst/msg.mi.es diff -u src/usr.sbin/sysinst/msg.mi.es:1.21 src/usr.sbin/sysinst/msg.mi.es:1.22 --- src/usr.sbin/sysinst/msg.mi.es:1.21 Thu Jan 9 13:22:30 2020 +++ src/usr.sbin/sysinst/msg.mi.es Thu Feb 6 19:41:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.es,v 1.21 2020/01/09 13:22:30 martin Exp $ */ +/* $NetBSD: msg.mi.es,v 1.22 2020/02/06 19:41:57 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1240,7 +1240,8 @@ message swap_display {swap} * $1 = swap partition name my_swap */ message Auto_add_swap_part -{A swap partition (named $1) seems to exist on $0. +{A swap partition (named $1) +seems to exist on $0. Do you want to use that?} message parttype_disklabel {BSD disklabel} Index: src/usr.sbin/sysinst/msg.mi.fr diff -u src/usr.sbin/sysinst/msg.mi.fr:1.25 src/usr.sbin/sysinst/msg.mi.fr:1.26 --- src/usr.sbin/sysinst/msg.mi.fr:1.25 Thu Jan 9 13:22:30 2020 +++ src/usr.sbin/sysinst/msg.mi.fr Thu Feb 6 19:41:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.fr,v 1.25 2020/01/09 13:22:30 martin Exp $ */ +/* $NetBSD: msg.mi.fr,v 1.26 2020/02/06 19:41:57 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1292,7 +1292,8 @@ message swap_display {swap} * $1 = swap partition name my_swap */ message Auto_add_swap_part -{A swap partition (named $1) seems to exist on $0. +{A swap partition (named $1) +seems to exist on $0. Do you want to use that?} message parttype_disklabel {BSD disklabel} Index: src/usr.sbin/sysinst/msg.mi.pl diff -u src/usr.sbin/sysinst/msg.mi.pl:1.28 src/usr.sbin/sysinst/msg.mi.pl:1.29 --- src/usr.sbin/sysinst/msg.mi.pl:1.28 Thu Jan 9 13:22:30 2020 +++ src/usr.sbin/sysinst/msg.mi.pl Thu Feb 6 19:41:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.pl,v 1.28 2020/01/09 13:22:30 martin Exp $ */ +/* $NetBSD: msg.mi.pl,v 1.29 2020/02/06 19:41:57 martin Exp $ */ /* Based on english version: */ /* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */ @@ -1191,7 +1191,8 @@ message swap_display {swap} * $1 = swap partition name my_swap */ message Auto_add_swap_part -{Partycja swap ($1) istnieje na $0. +{Partycja swap ($1) +istnieje na $0. Chcesz jej uzyc?} message parttype_disklabel {disklabel BSD}
CVS commit: src/sbin/devpubd
Module Name:src Committed By: kamil Date: Thu Feb 6 19:20:21 UTC 2020 Modified Files: src/sbin/devpubd: devpubd.c Log Message: Stop including unused header To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/devpubd/devpubd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/devpubd/devpubd.c diff -u src/sbin/devpubd/devpubd.c:1.4 src/sbin/devpubd/devpubd.c:1.5 --- src/sbin/devpubd/devpubd.c:1.4 Sun Feb 15 21:46:49 2015 +++ src/sbin/devpubd/devpubd.c Thu Feb 6 19:20:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: devpubd.c,v 1.4 2015/02/15 21:46:49 christos Exp $ */ +/* $NetBSD: devpubd.c,v 1.5 2020/02/06 19:20:21 kamil Exp $ */ /*- * Copyright (c) 2011 Jared D. McNeill @@ -36,14 +36,13 @@ #include __COPYRIGHT("@(#) Copyright (c) 2011-2015\ Jared D. McNeill . All rights reserved."); -__RCSID("$NetBSD: devpubd.c,v 1.4 2015/02/15 21:46:49 christos Exp $"); +__RCSID("$NetBSD: devpubd.c,v 1.5 2020/02/06 19:20:21 kamil Exp $"); #include #include #include #include #include -#include #include #include
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 19:08:38 UTC 2020 Modified Files: src/usr.sbin/sysinst: disks.c upgrade.c Log Message: PR bin/54944: make the "explicit single wedge" selection also work for upgrades. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/usr.sbin/sysinst/disks.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/upgrade.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.64 src/usr.sbin/sysinst/disks.c:1.65 --- src/usr.sbin/sysinst/disks.c:1.64 Thu Feb 6 16:28:10 2020 +++ src/usr.sbin/sysinst/disks.c Thu Feb 6 19:08:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.64 2020/02/06 16:28:10 martin Exp $ */ +/* $NetBSD: disks.c,v 1.65 2020/02/06 19:08:38 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1446,7 +1446,8 @@ find_part_by_name(const char *name, stru * List has not been filled, only "pm" is valid - check * that first. */ - if (pm->parts->pscheme->find_by_name != NULL) { + if (pm->parts != NULL && + pm->parts->pscheme->find_by_name != NULL) { id = pm->parts->pscheme->find_by_name(pm->parts, name); if (id != NO_PART) { *pno = id; @@ -1840,10 +1841,15 @@ mount_disks(struct install_partition_des assert((size_t)(l - fstabbuf) == num_entries); /* First the root device. */ - if (target_already_root()) + if (target_already_root()) { /* avoid needing to call target_already_root() again */ targetroot_mnt[0] = 0; - else { + } else if (pm->no_part) { + snprintf(devdev, sizeof devdev, _PATH_DEV "%s", pm->diskdev); + error = mount_root(devdev, true, false, install); + if (error != 0 && error != EBUSY) + return -1; + } else { for (i = 0; i < install->num; i++) { if (is_root_part_mount(install->infos[i].mount)) break; Index: src/usr.sbin/sysinst/upgrade.c diff -u src/usr.sbin/sysinst/upgrade.c:1.14 src/usr.sbin/sysinst/upgrade.c:1.15 --- src/usr.sbin/sysinst/upgrade.c:1.14 Thu Jan 16 13:56:24 2020 +++ src/usr.sbin/sysinst/upgrade.c Thu Feb 6 19:08:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: upgrade.c,v 1.14 2020/01/16 13:56:24 martin Exp $ */ +/* $NetBSD: upgrade.c,v 1.15 2020/02/06 19:08:38 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -65,19 +65,19 @@ do_upgrade(void) if (find_disks(msg_string(MSG_upgrade), !root_is_read_only()) < 0) return; - if (pm->parts == NULL && !pm->cur_system) { + if (pm->parts == NULL && !pm->cur_system && !pm->no_part) { hit_enter_to_continue(MSG_noroot, NULL); return; } - if (!pm->cur_system) { + if (!pm->cur_system && pm->parts != NULL) { if (pm->parts->pscheme->pre_update_verify) { if (pm->parts->pscheme->pre_update_verify(pm->parts)) pm->parts->pscheme->write_to_disk(pm->parts); } install_desc_from_parts(&install, pm->parts); - } else { + } else if (pm->cur_system) { install.cur_system = true; }
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 18:07:22 UTC 2020 Modified Files: src/usr.sbin/sysinst: mbr.c Log Message: PR bin/54944: explicitly reject GPT protective MBRs. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/mbr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/mbr.c diff -u src/usr.sbin/sysinst/mbr.c:1.30 src/usr.sbin/sysinst/mbr.c:1.31 --- src/usr.sbin/sysinst/mbr.c:1.30 Mon Jan 27 21:21:22 2020 +++ src/usr.sbin/sysinst/mbr.c Thu Feb 6 18:07:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.c,v 1.30 2020/01/27 21:21:22 martin Exp $ */ +/* $NetBSD: mbr.c,v 1.31 2020/02/06 18:07:22 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -156,6 +156,8 @@ static size_t mbr_get_free_spaces(const struct disk_part_free_space *result, size_t max_num_result, daddr_t min_size, daddr_t align, daddr_t lower_bound, daddr_t ignore); +static size_t mbr_type_from_gen_desc(const struct part_type_desc *desc); + /* * Notes on the extended partition editor. * @@ -999,6 +1001,20 @@ mbr_read_from_disk(const char *disk, dad return NULL; } mbr_calc_free_space(parts); + if (parts->dp.num_part == 1 && + parts->dp.free_space < parts->ptn_alignment) { + struct disk_part_info info; + + /* + * Check if this is a GPT protective MBR + */ + if (parts->dp.pscheme->get_part_info(&parts->dp, 0, &info) + && info.nat_type != NULL + && mbr_type_from_gen_desc(info.nat_type) == 0xEE) { + parts->dp.pscheme->free(&parts->dp); + return NULL; + } + } return &parts->dp; }
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 16:28:10 UTC 2020 Modified Files: src/usr.sbin/sysinst: disks.c txtwalk.c Log Message: PR bin/54944: deal with escaped spaces in NAME= syntax in /etc/fstab. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/usr.sbin/sysinst/disks.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/txtwalk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.63 src/usr.sbin/sysinst/disks.c:1.64 --- src/usr.sbin/sysinst/disks.c:1.63 Thu Feb 6 10:42:06 2020 +++ src/usr.sbin/sysinst/disks.c Thu Feb 6 16:28:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.63 2020/02/06 10:42:06 martin Exp $ */ +/* $NetBSD: disks.c,v 1.64 2020/02/06 16:28:10 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1520,6 +1520,16 @@ process_found_fs(struct data *list, size if (strcmp(item->head, name_prefix) == 0) { /* this fstab entry uses NAME= syntax */ + + /* unescape */ + char *src, *dst; + for (src = list[0].u.s_val, dst =src; src[0] != 0; ) { + if (src[0] == '\\' && src[1] != 0) +src++; + *dst++ = *src++; + } + *dst = 0; + if (!find_part_by_name(list[0].u.s_val, &parts, &pno) || parts == NULL || pno == NO_PART) return 0; Index: src/usr.sbin/sysinst/txtwalk.c diff -u src/usr.sbin/sysinst/txtwalk.c:1.2 src/usr.sbin/sysinst/txtwalk.c:1.3 --- src/usr.sbin/sysinst/txtwalk.c:1.2 Wed Aug 7 10:08:04 2019 +++ src/usr.sbin/sysinst/txtwalk.c Thu Feb 6 16:28:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: txtwalk.c,v 1.2 2019/08/07 10:08:04 martin Exp $ */ +/* $NetBSD: txtwalk.c,v 1.3 2020/02/06 16:28:10 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -239,9 +239,14 @@ finddata(const struct lookfor *item, cha break; case 's': /* Matches a 'space' separated string. */ len = 0; -while (line[len] && !isspace((unsigned char)line[len]) -&& line[len] != fmt[1]) +while (line[len] +&& !isspace((unsigned char)line[len]) +&& line[len] != fmt[1]) { + if (line[len] == '\\' + && line[len] != 0) + len++; len++; +} found[*numfound].what = STR; found[(*numfound)++].u.s_val = line; line[len] = 0;
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 15:08:04 UTC 2020 Modified Files: src/usr.sbin/sysinst: target.c Log Message: Do not assum a partitioning scheme that supports innner partitions always needs to actually have such partitions defined. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/target.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/target.c diff -u src/usr.sbin/sysinst/target.c:1.11 src/usr.sbin/sysinst/target.c:1.12 --- src/usr.sbin/sysinst/target.c:1.11 Thu Jan 9 13:22:30 2020 +++ src/usr.sbin/sysinst/target.c Thu Feb 6 15:08:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: target.c,v 1.11 2020/01/09 13:22:30 martin Exp $ */ +/* $NetBSD: target.c,v 1.12 2020/02/06 15:08:04 martin Exp $ */ /* * Copyright 1997 Jonathan Stone @@ -71,7 +71,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: target.c,v 1.11 2020/01/09 13:22:30 martin Exp $"); +__RCSID("$NetBSD: target.c,v 1.12 2020/02/06 15:08:04 martin Exp $"); #endif /* @@ -157,7 +157,7 @@ target_already_root(void) static struct pm_devs *last_pm; static int last_res; part_id ptn; - struct disk_partitions *parts; + struct disk_partitions *parts, *inner; struct disk_part_info info; if (pm == last_pm) @@ -180,9 +180,12 @@ target_already_root(void) return last_res; } - if (pm->parts->pscheme->secondary_partitions != NULL) - parts = pm->parts->pscheme->secondary_partitions(parts, + if (pm->parts->pscheme->secondary_partitions != NULL) { + inner = pm->parts->pscheme->secondary_partitions(parts, pm->ptstart, false); + if (inner != NULL) + parts = inner; + } for (ptn = 0; ptn < parts->num_part; ptn++) { if (!parts->pscheme->get_part_info(parts, ptn, &info))
CVS commit: src/sys/dev/pci
Module Name:src Committed By: macallan Date: Thu Feb 6 13:31:30 UTC 2020 Modified Files: src/sys/dev/pci: radeonfb.c Log Message: sent PMF events when (un)blanking so things like lmu can turn their lights on or off as well To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/dev/pci/radeonfb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/radeonfb.c diff -u src/sys/dev/pci/radeonfb.c:1.105 src/sys/dev/pci/radeonfb.c:1.106 --- src/sys/dev/pci/radeonfb.c:1.105 Thu Aug 15 00:50:11 2019 +++ src/sys/dev/pci/radeonfb.c Thu Feb 6 13:31:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: radeonfb.c,v 1.105 2019/08/15 00:50:11 rin Exp $ */ +/* $NetBSD: radeonfb.c,v 1.106 2020/02/06 13:31:30 macallan Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.105 2019/08/15 00:50:11 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.106 2020/02/06 13:31:30 macallan Exp $"); #include #include @@ -1173,6 +1173,9 @@ radeonfb_ioctl(void *v, void *vs, (*(unsigned int *)d == WSDISPLAYIO_VIDEO_OFF)); radeonfb_switch_backlight(dp, (*(unsigned int *)d == WSDISPLAYIO_VIDEO_ON)); + pmf_event_inject(NULL, + (*(unsigned int *)d == WSDISPLAYIO_VIDEO_ON) ? + PMFE_DISPLAY_ON : PMFE_DISPLAY_OFF); return 0; case WSDISPLAYIO_GETCMAP:
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: skrll Date: Thu Feb 6 12:51:14 UTC 2020 Modified Files: src/sys/arch/evbarm/conf: RPI2 Log Message: Add bcm2837-rpi-3-a-plus.dts to DTS. Requested by logix To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/RPI2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/RPI2 diff -u src/sys/arch/evbarm/conf/RPI2:1.9 src/sys/arch/evbarm/conf/RPI2:1.10 --- src/sys/arch/evbarm/conf/RPI2:1.9 Thu Feb 6 12:49:59 2020 +++ src/sys/arch/evbarm/conf/RPI2 Thu Feb 6 12:51:13 2020 @@ -1,5 +1,5 @@ # -# $NetBSD: RPI2,v 1.9 2020/02/06 12:49:59 skrll Exp $ +# $NetBSD: RPI2,v 1.10 2020/02/06 12:51:13 skrll Exp $ # # RPi2 -- Raspberry Pi 2 # @@ -29,6 +29,7 @@ options __HAVE_GENERIC_CPU_INITCLOCKS makeoptions DTS=" bcm2836-rpi-2-b.dts + bcm2837-rpi-3-a-plus.dts bcm2837-rpi-3-b-plus.dts bcm2837-rpi-3-b.dts bcm2837-rpi-cm3-io3.dts
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: skrll Date: Thu Feb 6 12:50:00 UTC 2020 Modified Files: src/sys/arch/evbarm/conf: RPI2 Log Message: Sort DTS To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/RPI2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/RPI2 diff -u src/sys/arch/evbarm/conf/RPI2:1.8 src/sys/arch/evbarm/conf/RPI2:1.9 --- src/sys/arch/evbarm/conf/RPI2:1.8 Sat Mar 9 15:22:45 2019 +++ src/sys/arch/evbarm/conf/RPI2 Thu Feb 6 12:49:59 2020 @@ -1,5 +1,5 @@ # -# $NetBSD: RPI2,v 1.8 2019/03/09 15:22:45 skrll Exp $ +# $NetBSD: RPI2,v 1.9 2020/02/06 12:49:59 skrll Exp $ # # RPi2 -- Raspberry Pi 2 # @@ -29,8 +29,8 @@ options __HAVE_GENERIC_CPU_INITCLOCKS makeoptions DTS=" bcm2836-rpi-2-b.dts - bcm2837-rpi-3-b.dts bcm2837-rpi-3-b-plus.dts + bcm2837-rpi-3-b.dts bcm2837-rpi-cm3-io3.dts " # Architecture options
CVS commit: src/distrib/sets
Module Name:src Committed By: uki Date: Thu Feb 6 12:36:38 UTC 2020 Modified Files: src/distrib/sets: regpkgset Log Message: Building X11 system packages by "build.sh syspkgs" To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/distrib/sets/regpkgset Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/regpkgset diff -u src/distrib/sets/regpkgset:1.13 src/distrib/sets/regpkgset:1.14 --- src/distrib/sets/regpkgset:1.13 Wed Oct 2 11:16:00 2019 +++ src/distrib/sets/regpkgset Thu Feb 6 12:36:38 2020 @@ -1,6 +1,6 @@ #! /bin/sh # -# $NetBSD: regpkgset,v 1.13 2019/10/02 11:16:00 maya Exp $ +# $NetBSD: regpkgset,v 1.14 2020/02/06 12:36:38 uki Exp $ # # Copyright (c) 2003,2009 The NetBSD Foundation, Inc. # All rights reserved. @@ -123,7 +123,7 @@ if [ $# -lt 1 ]; then fi case "$1" in -all) list="base comp etc games man misc rescue tests text" ;; +all) list="base comp etc games man misc rescue tests text xbase xcomp xetc xfont xserver" ;; *) list="$*" ;; esac
CVS commit: src/tests/lib/libc/c063
Module Name:src Committed By: martin Date: Thu Feb 6 12:18:06 UTC 2020 Modified Files: src/tests/lib/libc/c063: t_o_search.c Log Message: Add a few O_SEARCH tests, currently only run on FreeBSD. Patch from Kyle Evans. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/c063/t_o_search.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/c063/t_o_search.c diff -u src/tests/lib/libc/c063/t_o_search.c:1.8 src/tests/lib/libc/c063/t_o_search.c:1.9 --- src/tests/lib/libc/c063/t_o_search.c:1.8 Wed Feb 5 17:13:24 2020 +++ src/tests/lib/libc/c063/t_o_search.c Thu Feb 6 12:18:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13:24 martin Exp $ */ +/* $NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,13 +29,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_o_search.c,v 1.8 2020/02/05 17:13:24 martin Exp $"); +__RCSID("$NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $"); #include -#include +#include #include +#include #include #include #include @@ -50,7 +51,7 @@ __RCSID("$NetBSD: t_o_search.c,v 1.8 202 * until a decision is reached about the semantics of O_SEARCH and a * non-broken implementation is available. */ -#if (O_MASK & O_SEARCH) != 0 +#if defined(__FreeBSD__) || (O_MASK & O_SEARCH) != 0 #define USE_O_SEARCH #endif @@ -263,6 +264,70 @@ ATF_TC_BODY(o_search_notdir, tc) ATF_REQUIRE(close(dfd) == 0); } +#ifdef USE_O_SEARCH +ATF_TC(o_search_nord); +ATF_TC_HEAD(o_search_nord, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that openat succeeds with no read permission"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(o_search_nord, tc) +{ + int dfd, fd; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); + ATF_REQUIRE(close(fd) == 0); + + ATF_REQUIRE(chmod(DIR, 0100) == 0); + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + + ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) != -1); + + ATF_REQUIRE(close(dfd) == 0); +} + +ATF_TC(o_search_getdents); +ATF_TC_HEAD(o_search_getdents, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that O_SEARCH forbids getdents"); +} +ATF_TC_BODY(o_search_getdents, tc) +{ + char buf[1024]; + int dfd; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + ATF_REQUIRE(getdents(dfd, buf, sizeof(buf)) < 0); + ATF_REQUIRE(close(dfd) == 0); +} + +ATF_TC(o_search_revokex); +ATF_TC_HEAD(o_search_revokex, tc) +{ + atf_tc_set_md_var(tc, "descr", "See that *at behaves after chmod -x"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(o_search_revokex, tc) +{ + int dfd, fd; + struct stat sb; + + ATF_REQUIRE(mkdir(DIR, 0755) == 0); + ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); + ATF_REQUIRE(close(fd) == 0); + + ATF_REQUIRE((dfd = open(DIR, O_SEARCH, 0)) != -1); + + /* Drop permissions. The kernel must still not check the exec bit. */ + ATF_REQUIRE(chmod(DIR, ) == 0); + ATF_REQUIRE(fstatat(dfd, BASEFILE, &sb, 0) == 0); + + ATF_REQUIRE(close(dfd) == 0); +} +#endif /* USE_O_SEARCH */ + ATF_TP_ADD_TCS(tp) { @@ -277,6 +342,11 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, o_search_unpriv_flag2); #endif ATF_TP_ADD_TC(tp, o_search_notdir); +#ifdef USE_O_SEARCH + ATF_TP_ADD_TC(tp, o_search_nord); + ATF_TP_ADD_TC(tp, o_search_getdents); + ATF_TP_ADD_TC(tp, o_search_revokex); +#endif return atf_no_error(); }
CVS commit: src/distrib/sets/lists/xcomp
Module Name:src Committed By: uki Date: Thu Feb 6 12:13:45 UTC 2020 Modified Files: src/distrib/sets/lists/xcomp: mi Log Message: Fix incorrect package name in xcomp To generate a diff of this commit: cvs rdiff -u -r1.215 -r1.216 src/distrib/sets/lists/xcomp/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/xcomp/mi diff -u src/distrib/sets/lists/xcomp/mi:1.215 src/distrib/sets/lists/xcomp/mi:1.216 --- src/distrib/sets/lists/xcomp/mi:1.215 Sat Jan 25 00:12:42 2020 +++ src/distrib/sets/lists/xcomp/mi Thu Feb 6 12:13:45 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.215 2020/01/25 00:12:42 uki Exp $ +# $NetBSD: mi,v 1.216 2020/02/06 12:13:45 uki Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -1779,37 +1779,37 @@ ./usr/X11R7/man/cat3/XExposeEvent.0 xcomp-libX11-catman .cat,xorg ./usr/X11R7/man/cat3/XExtentsOfFontSet.0 xcomp-libX11-catman .cat,xorg ./usr/X11R7/man/cat3/XF86DGA.0xcomp-libXxf86dga-catman .cat,xorg -./usr/X11R7/man/cat3/XF86Misc.0libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscGetKbdSettings.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscGetMouseSettings.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscGetSaver.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscQueryExtension.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscQueryVersion.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscSetKbdSettings.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscSetMouseSettings.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86MiscSetSaver.0 libXxf86misc-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VM.0libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeDeleteModeLine.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetAllModeLines.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetDotClocks.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetGamma.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetGammaRamp.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetGammaRampSize.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetModeLine.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetMonitor.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetPermissions.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeGetViewPort.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeLockModeSwitch.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeModModeLine.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeQueryExtension.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeQueryVersion.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeSetClientVersion.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeSetGamma.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeSetGammaRamp.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeSetViewPort.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeSwitchMode.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeSwitchToMode.0 libXxf86vm-catman .cat,xorg -./usr/X11R7/man/cat3/XF86VidModeValidateModeLine.0 libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86Misc.0xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscGetKbdSettings.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscGetMouseSettings.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscGetSaver.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscQueryExtension.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscQueryVersion.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscSetKbdSettings.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscSetMouseSettings.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86MiscSetSaver.0 xcomp-libXxf86misc-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VM.0xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeDeleteModeLine.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetAllModeLines.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetDotClocks.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetGamma.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetGammaRamp.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetGammaRampSize.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetModeLine.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetMonitor.0 xcomp-libXxf86vm-catman .cat,xorg +./usr/X11R7/man/cat3/XF86VidModeGetPermissions.0 xcomp-lib
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 11:55:18 UTC 2020 Modified Files: src/usr.sbin/sysinst: partman.c Log Message: Deal with partitioning schemes having no inner counterpart. Avoid NULL derefs. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/partman.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/partman.c diff -u src/usr.sbin/sysinst/partman.c:1.49 src/usr.sbin/sysinst/partman.c:1.50 --- src/usr.sbin/sysinst/partman.c:1.49 Mon Jan 27 21:21:22 2020 +++ src/usr.sbin/sysinst/partman.c Thu Feb 6 11:55:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: partman.c,v 1.49 2020/01/27 21:21:22 martin Exp $ */ +/* $NetBSD: partman.c,v 1.50 2020/02/06 11:55:18 martin Exp $ */ /* * Copyright 2012 Eugene Lozovoy @@ -3249,7 +3249,7 @@ pm_edit_partitions(struct part_entry *pe { struct pm_devs *my_pm = pm_from_pe(pe); struct partition_usage_set pset = { 0 }; - struct disk_partitions *parts; + struct disk_partitions *parts, *np; if (!my_pm) return; @@ -3264,12 +3264,16 @@ pm_edit_partitions(struct part_entry *pe if (my_pm->parts->pscheme->secondary_scheme != NULL) { if (!edit_outer_parts(my_pm->parts)) goto done; - parts = get_inner_parts(parts); + np = get_inner_parts(parts); + if (np != NULL) + parts = np; } - usage_set_from_parts(&pset, parts); - edit_and_check_label(my_pm, &pset, false); - free_usage_set(&pset); + if (parts != NULL) { + usage_set_from_parts(&pset, parts); + edit_and_check_label(my_pm, &pset, false); + free_usage_set(&pset); + } done: pm_partusage(my_pm, -1, -1);
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 11:46:35 UTC 2020 Modified Files: src/usr.sbin/sysinst: disklabel.c Log Message: Remove a bogus assert: when reading disklabel partitions and the outer (MBR) partitioning has changed, but the changes have not yet been written back to disk, we need to ignore the kernels idea of the disklabel and instead continue with an empty one. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/sysinst/disklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/disklabel.c diff -u src/usr.sbin/sysinst/disklabel.c:1.34 src/usr.sbin/sysinst/disklabel.c:1.35 --- src/usr.sbin/sysinst/disklabel.c:1.34 Mon Jan 27 21:21:22 2020 +++ src/usr.sbin/sysinst/disklabel.c Thu Feb 6 11:46:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.34 2020/01/27 21:21:22 martin Exp $ */ +/* $NetBSD: disklabel.c,v 1.35 2020/02/06 11:46:35 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -237,8 +237,12 @@ disklabel_parts_read(const char *disk, d daddr_t dlend = start + parts->l.d_partitions[RAW_PART-1].p_size; - if (dlstart < start && dlend > (start+len)) { - assert(false); + if (dlstart < start || dlend > (start+len)) { + /* + * Kernel assumes different outer partion + * (probably not yet written back to disk) + * so this label is invalid. + */ free(parts); close(fd); return NULL;
CVS commit: src/usr.sbin/sysinst/arch/i386
Module Name:src Committed By: martin Date: Thu Feb 6 10:47:33 UTC 2020 Modified Files: src/usr.sbin/sysinst/arch/i386: md.c Log Message: PR install/54934: always use -f on the installboot invocation. We come here post-newfs (and maybe should have dd'd zeros to the start of the disk before newfs instead). To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/arch/i386/md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/arch/i386/md.c diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.29 src/usr.sbin/sysinst/arch/i386/md.c:1.30 --- src/usr.sbin/sysinst/arch/i386/md.c:1.29 Mon Jan 27 21:21:23 2020 +++ src/usr.sbin/sysinst/arch/i386/md.c Thu Feb 6 10:47:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.29 2020/01/27 21:21:23 martin Exp $ */ +/* $NetBSD: md.c,v 1.30 2020/02/06 10:47:33 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -291,7 +291,7 @@ md_post_newfs_bios(struct install_partit "console=%s,speed=%u", consoles[boottype.bp_consdev], boottype.bp_conspeed); ret = run_program(RUN_DISPLAY, - "/usr/sbin/installboot -o %s %s %s", + "/usr/sbin/installboot -f -o %s %s %s", boot_options, rdev, bootxx_filename); free(bootxx_filename); } else {
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Feb 6 10:42:06 UTC 2020 Modified Files: src/usr.sbin/sysinst: disks.c Log Message: bootxx_name() - fix oversight in previous change (do not assume first partition is the root partition) To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/usr.sbin/sysinst/disks.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.62 src/usr.sbin/sysinst/disks.c:1.63 --- src/usr.sbin/sysinst/disks.c:1.62 Mon Jan 27 21:21:22 2020 +++ src/usr.sbin/sysinst/disks.c Thu Feb 6 10:42:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.62 2020/01/27 21:21:22 martin Exp $ */ +/* $NetBSD: disks.c,v 1.63 2020/02/06 10:42:06 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -2006,7 +2006,7 @@ bootxx_name(struct install_partition_des switch (fstype) { #if defined(BOOTXX_FFSV1) || defined(BOOTXX_FFSV2) case FS_BSDFFS: - if (install->infos[0].fs_version == 2) { + if (install->infos[i].fs_version == 2) { #ifdef BOOTXX_FFSV2 bootxxname = BOOTXX_FFSV2; #else
CVS commit: src/usr.bin/locate/locate
Module Name:src Committed By: simonb Date: Thu Feb 6 08:45:44 UTC 2020 Modified Files: src/usr.bin/locate/locate: locate.updatedb.8 updatedb.sh Log Message: Add support for specifying an alternate locate.updatedb config file. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/locate/locate/locate.updatedb.8 cvs rdiff -u -r1.15 -r1.16 src/usr.bin/locate/locate/updatedb.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/locate/locate/locate.updatedb.8 diff -u src/usr.bin/locate/locate/locate.updatedb.8:1.3 src/usr.bin/locate/locate/locate.updatedb.8:1.4 --- src/usr.bin/locate/locate/locate.updatedb.8:1.3 Mon Sep 22 13:10:25 2008 +++ src/usr.bin/locate/locate/locate.updatedb.8 Thu Feb 6 08:45:44 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: locate.updatedb.8,v 1.3 2008/09/22 13:10:25 hubertf Exp $ +.\" $NetBSD: locate.updatedb.8,v 1.4 2020/02/06 08:45:44 simonb Exp $ .\" .\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 5, 2005 +.Dd February 6, 2020 .Dt LOCATE.UPDATEDB 8 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nd update locate database .Sh SYNOPSIS .Nm /usr/libexec/locate.updatedb +.Op Fl c Ar file .Sh DESCRIPTION The .Nm @@ -46,6 +47,19 @@ It is usually run once per week, see .Pp The file systems and files (not) scanned can be configured in .Xr locate.conf 5 . +.Sh OPTIONS +The +.Nm +program supports this option: +.Bl -tag -width XcXfileXX +.It Fl c Ar file +Use +.Ar file +(in +.Xr locate.conf 5 +format) as the configuration file instead of the default +.Pa /etc/locate.conf . +.El .Sh FILES .Bl -tag -width /usr/libexec/locate.updatedb -compact .It Pa /var/db/locate.database Index: src/usr.bin/locate/locate/updatedb.sh diff -u src/usr.bin/locate/locate/updatedb.sh:1.15 src/usr.bin/locate/locate/updatedb.sh:1.16 --- src/usr.bin/locate/locate/updatedb.sh:1.15 Mon Aug 4 21:56:30 2014 +++ src/usr.bin/locate/locate/updatedb.sh Thu Feb 6 08:45:44 2020 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: updatedb.sh,v 1.15 2014/08/04 21:56:30 apb Exp $ +# $NetBSD: updatedb.sh,v 1.16 2020/02/06 08:45:44 simonb Exp $ # # Copyright (c) 1989, 1993 # The Regents of the University of California. All rights reserved. @@ -40,10 +40,9 @@ # LIBDIR="/usr/libexec" # for subprograms - # for temp files -TMPDIR=/tmp +TMPDIR="/tmp"# for temp files FCODES="/var/db/locate.database" # the database -CONF=/etc/locate.conf # configuration file +CONF="/etc/locate.conf" # configuration file PATH="/bin:/usr/bin" @@ -97,6 +96,26 @@ shell_quote() printf "%s\n" "$result" )} +args=`getopt c: $*` +if [ $? -ne 0 ]; then + progname=`basename $0` + echo 'Usage: ...' + echo "usage: ${progname} [-c config]" + exit 2 +fi +set -- $args +while [ $# -gt 0 ]; do + case "$1" in + -c) + CONF=$2; shift + ;; + --) + shift; break + ;; + esac + shift +done + # read configuration file if [ -f "$CONF" ]; then while read -r com args; do @@ -149,6 +168,13 @@ if [ -f "$CONF" ]; then echo "$CONF: workdir: $1 nonexistent" >&2 fi ;; + database) + if [ $# -ne 1 ]; then +echo "$CONF: database takes exactly one argument" >&2 + else +FCODES="$1" + fi + ;; *) echo "$CONF: $com: unknown config command" >&2 exit 1