CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Tue May 10 00:02:31 UTC 2016 Modified Files: src/usr.bin/make: meta.c Log Message: Apply realpath() to p before matching against metaIgnorePaths. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/usr.bin/make/meta.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.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.54 src/usr.bin/make/meta.c:1.55 --- src/usr.bin/make/meta.c:1.54 Fri Mar 11 07:01:21 2016 +++ src/usr.bin/make/meta.c Tue May 10 00:02:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.54 2016/03/11 07:01:21 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.55 2016/05/10 00:02:31 sjg Exp $ */ /* * Implement 'meta' mode. @@ -1205,14 +1205,16 @@ meta_oodate(GNode *gn, Boolean oodate) * be part of the dependencies because * they are _expected_ to change. */ - if (*p == '/' && - Lst_ForEach(metaIgnorePaths, prefix_match, p)) { + if (*p == '/') { + realpath(p, fname1); /* clean it up */ + if (Lst_ForEach(metaIgnorePaths, prefix_match, fname1)) { #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: ignoring: %s\n", -p); + if (DEBUG(META)) +fprintf(debug_file, "meta_oodate: ignoring: %s\n", + p); #endif - break; + break; + } } /*
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Tue May 10 00:02:31 UTC 2016 Modified Files: src/usr.bin/make: meta.c Log Message: Apply realpath() to p before matching against metaIgnorePaths. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/usr.bin/make/meta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 22:34:37 UTC 2016 Modified Files: src/tests/bin/sh: t_redir.sh Log Message: PR bin/48875 PR bin/51123This adds tests more that verify fide descriptor redirection works correctly (including that the bugs reported in those PRs are fixed.) Note that the tests for 48875 are slow, so one of the new test cases ends up running > 25 seconds (just doing sleeps) - each individual test is just a few seconds, but there are several of them. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/bin/sh/t_redir.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/bin/sh/t_redir.sh diff -u src/tests/bin/sh/t_redir.sh:1.6 src/tests/bin/sh/t_redir.sh:1.7 --- src/tests/bin/sh/t_redir.sh:1.6 Mon May 2 01:47:14 2016 +++ src/tests/bin/sh/t_redir.sh Mon May 9 22:34:37 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_redir.sh,v 1.6 2016/05/02 01:47:14 christos Exp $ +# $NetBSD: t_redir.sh,v 1.7 2016/05/09 22:34:37 kre Exp $ # # Copyright (c) 2016 The NetBSD Foundation, Inc. # All rights reserved. @@ -472,6 +472,50 @@ local_redirections_body() fi } +atf_test_case named_fd_redirections +named_fd_redirections_head() +{ + atf_set "descr" "Tests redirections to /dev/stdout (etc)" + +} +named_fd_redirections_body() +{ + if test -c /dev/stdout + then + atf_check -s exit:0 -o inline:'OK\n' -e empty \ + ${TEST_SH} -c 'echo OK >/dev/stdout' + atf_check -s exit:0 -o inline:'OK\n' -e empty \ + ${TEST_SH} -c '/bin/echo OK >/dev/stdout' + fi + + if test -c /dev/stdin + then + atf_require_prog cat + + echo GOOD | atf_check -s exit:0 -o inline:'GOOD\n' -e empty \ + ${TEST_SH} -c 'read var /dev/stderr >&2' + atf_check -s exit:0 -e inline:'OK\n' -o empty \ + ${TEST_SH} -c '/bin/echo OK 2>/dev/stderr >&2' + fi + + if test -c /dev/fd/8 && test -c /dev/fd/9 + then + atf_check -s exit:0 -o inline:'EIGHT\n' -e empty \ + ${TEST_SH} -c 'printf "%s\n" EIGHT 8>&1 >/dev/fd/8 | + cat 9<&0 f-def + f() { + printf '%s\n' In-Func + } + DONE + + atf_check -s exit:0 -o inline:'In-Func\nsuccess1\n' -e empty \ + ${TEST_SH} -c ". ./f-def; f ; printf '%s\n' success1" + atf_check -s exit:0 -o inline:'success2\n' -e empty \ + ${TEST_SH} -c ". ./f-def; f >/dev/null; printf '%s\n' success2" + atf_check -s exit:0 -o inline:'success3\n' -e empty \ + ${TEST_SH} -c ". ./f-def; f >&- ; printf '%s\n' success3" + atf_check -s exit:0 -o inline:'In-Func\nsuccess4\n' -e empty \ + ${TEST_SH} -c ". ./f-def; f & wait; printf '%s\n' success4" + atf_check -s exit:0 -o inline:'success5\n' -e empty \ + ${TEST_SH} -c ". ./f-def; f >&- & wait; printf '%s\n' success5" + atf_check -s exit:0 -o inline:'In-Func\nIn-Func\nsuccess6\n' -e empty \ + ${TEST_SH} -c ". ./f-def; f;f; printf '%s\n' success6" + atf_check -s exit:0 -o inline:'In-Func\nIn-Func\nsuccess7\n' -e empty \ + ${TEST_SH} -c ". ./f-def; { f;f;}; printf '%s\n' success7" + atf_check -s exit:0 -o inline:'In-Func\nIn-Func\nsuccess8\n' -e empty \ + ${TEST_SH} -c ". ./f-def; { f;f;}& wait; printf '%s\n' success8" + atf_check -s exit:0 -o inline:'In-Func\nsuccess9\n' -e empty \ + ${TEST_SH} -c \ + ". ./f-def; { f>/dev/null;f;}& wait; printf '%s\n' success9" + atf_check -s exit:0 -o inline:'In-Func\nsuccess10\n' -e empty \ + ${TEST_SH} -c \ + ". ./f-def; { f;f>/dev/null;}& wait; printf '%s\n' success10" + + # Tests with sh reading stdin, which is not quite the same internal + # mechanism. + echo ". ./f-def || echo >&2 FAIL + f + printf '%s\n' stdin1 + "| atf_check -s exit:0 -o inline:'In-Func\nstdin1\n' -e empty ${TEST_SH} + + echo ' + . ./f-def || echo >&2 FAIL + f >&- + printf '%s\n' stdin2 + ' | atf_check -s exit:0 -o inline:'stdin2\n' -e empty ${TEST_SH} + + cat <<- 'DONE' > fgh.def + f() { + echo -n f >&3 + sleep 4 + echo -n F >&3 + } + g() { + echo -n g >&3 + sleep 2 + echo -n G >&3 + } + h() { + echo -n h >&3 + } + DONE + + atf_check -s exit:0 -o inline:'fFgGh' -e empty \ + ${TEST_SH} -c '. ./fgh.def || echo >&2 FAIL + exec 3>&1 + f; g; h' + + atf_check -s exit:0 -o inline:'fghGF' -e empty \ + ${TEST_SH} -c '. ./fgh.def || echo >&2 FAIL + exec 3>&1 + f & sleep 1; g & sleep 1; h; wait' + + atf_check -s exit:0 -o inline:'fFgGhX Y\n' -e empty \ + ${TEST_SH} -c '. ./fgh.def || echo >&2 FAIL + exec 3>&1 + echo X $( f ; g ; h ) Y' + + # This one is the real test for PR bin/48875. If the + # cmdsub does not complete before f g (and h) exit, + # then the 'F' & 'G' will precede 'X Y' in the output. + # If the cmdsub finishes while f & g are still running, + # then the X Y will appear before the F and G. + # The trailing "sleep 3" is just so we catch all the + # output (otherwise atf_check will be finished while + # f & g are still sleeping). + + atf_check -s exit:0 -o inline:'fghX Y\nGF' -e empty \ + ${TEST_SH} -c '. ./fgh.def || echo >&2 FAIL + exec
CVS commit: src/tests/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 22:34:37 UTC 2016 Modified Files: src/tests/bin/sh: t_redir.sh Log Message: PR bin/48875 PR bin/51123This adds tests more that verify fide descriptor redirection works correctly (including that the bugs reported in those PRs are fixed.) Note that the tests for 48875 are slow, so one of the new test cases ends up running > 25 seconds (just doing sleeps) - each individual test is just a few seconds, but there are several of them. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/bin/sh/t_redir.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Mon May 9 21:52:43 UTC 2016 Modified Files: src/sys/dev/usb: ohci.c Log Message: Don't forget to use HTOO32 when adding OHCI_TD_R to td_flags for short reads. Should fix problems with BE machines and ohci as reported on current-users by Michael To generate a diff of this commit: cvs rdiff -u -r1.261 -r1.262 src/sys/dev/usb/ohci.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/usb/ohci.c diff -u src/sys/dev/usb/ohci.c:1.261 src/sys/dev/usb/ohci.c:1.262 --- src/sys/dev/usb/ohci.c:1.261 Fri May 6 13:03:06 2016 +++ src/sys/dev/usb/ohci.c Mon May 9 21:52:43 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.261 2016/05/06 13:03:06 skrll Exp $ */ +/* $NetBSD: ohci.c,v 1.262 2016/05/09 21:52:43 skrll Exp $ */ /* * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.261 2016/05/06 13:03:06 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.262 2016/05/09 21:52:43 skrll Exp $"); #include "opt_usb.h" @@ -664,7 +664,7 @@ ohci_reset_std_chain(ohci_softc_t *sc, s } } cur->td.td_flags |= - (xfer->ux_flags & USBD_SHORT_XFER_OK ? OHCI_TD_R : 0); + HTOO32(xfer->ux_flags & USBD_SHORT_XFER_OK ? OHCI_TD_R : 0); if (!rd && (flags & USBD_FORCE_SHORT_XFER) &&
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Mon May 9 21:52:43 UTC 2016 Modified Files: src/sys/dev/usb: ohci.c Log Message: Don't forget to use HTOO32 when adding OHCI_TD_R to td_flags for short reads. Should fix problems with BE machines and ohci as reported on current-users by Michael To generate a diff of this commit: cvs rdiff -u -r1.261 -r1.262 src/sys/dev/usb/ohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:46:56 UTC 2016 Modified Files: src/lib/libedit: chared.c chared.h chartype.c chartype.h common.c el.c el.h emacs.c hist.c hist.h keymacro.c keymacro.h makelist map.c map.h parse.c parse.h prompt.c prompt.h read.c read.h refresh.c refresh.h search.c search.h sig.c sig.h sys.h terminal.c terminal.h tty.c tty.h vi.c Log Message: s/protected/libedit_private/g To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/lib/libedit/chared.c cvs rdiff -u -r1.28 -r1.29 src/lib/libedit/chared.h src/lib/libedit/hist.c \ src/lib/libedit/makelist cvs rdiff -u -r1.29 -r1.30 src/lib/libedit/chartype.c cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/chartype.h cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/common.c cvs rdiff -u -r1.90 -r1.91 src/lib/libedit/el.c cvs rdiff -u -r1.39 -r1.40 src/lib/libedit/el.h src/lib/libedit/parse.c cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/emacs.c cvs rdiff -u -r1.21 -r1.22 src/lib/libedit/hist.h src/lib/libedit/keymacro.c cvs rdiff -u -r1.5 -r1.6 src/lib/libedit/keymacro.h cvs rdiff -u -r1.50 -r1.51 src/lib/libedit/map.c src/lib/libedit/refresh.c cvs rdiff -u -r1.12 -r1.13 src/lib/libedit/map.h cvs rdiff -u -r1.8 -r1.9 src/lib/libedit/parse.h src/lib/libedit/terminal.h cvs rdiff -u -r1.25 -r1.26 src/lib/libedit/prompt.c src/lib/libedit/sig.c cvs rdiff -u -r1.14 -r1.15 src/lib/libedit/prompt.h cvs rdiff -u -r1.95 -r1.96 src/lib/libedit/read.c cvs rdiff -u -r1.10 -r1.11 src/lib/libedit/read.h src/lib/libedit/sig.h cvs rdiff -u -r1.9 -r1.10 src/lib/libedit/refresh.h cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/search.c cvs rdiff -u -r1.13 -r1.14 src/lib/libedit/search.h cvs rdiff -u -r1.26 -r1.27 src/lib/libedit/sys.h cvs rdiff -u -r1.31 -r1.32 src/lib/libedit/terminal.c cvs rdiff -u -r1.64 -r1.65 src/lib/libedit/tty.c cvs rdiff -u -r1.20 -r1.21 src/lib/libedit/tty.h cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/chared.c diff -u src/lib/libedit/chared.c:1.54 src/lib/libedit/chared.c:1.55 --- src/lib/libedit/chared.c:1.54 Mon Apr 18 13:01:19 2016 +++ src/lib/libedit/chared.c Mon May 9 17:46:56 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.54 2016/04/18 17:01:19 christos Exp $ */ +/* $NetBSD: chared.c,v 1.55 2016/05/09 21:46:56 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.54 2016/04/18 17:01:19 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.55 2016/05/09 21:46:56 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -60,7 +60,7 @@ static void ch__clearmacro (EditLine *); /* cv_undo(): * Handle state for the vi undo command */ -protected void +libedit_private void cv_undo(EditLine *el) { c_undo_t *vu = >el_chared.c_undo; @@ -84,7 +84,7 @@ cv_undo(EditLine *el) /* cv_yank(): * Save yank/delete data for paste */ -protected void +libedit_private void cv_yank(EditLine *el, const wchar_t *ptr, int size) { c_kill_t *k = >el_chared.c_kill; @@ -97,7 +97,7 @@ cv_yank(EditLine *el, const wchar_t *ptr /* c_insert(): * Insert num characters */ -protected void +libedit_private void c_insert(EditLine *el, int num) { wchar_t *cp; @@ -119,7 +119,7 @@ c_insert(EditLine *el, int num) /* c_delafter(): * Delete num characters after the cursor */ -protected void +libedit_private void c_delafter(EditLine *el, int num) { @@ -145,7 +145,7 @@ c_delafter(EditLine *el, int num) /* c_delafter1(): * Delete the character after the cursor, do not yank */ -protected void +libedit_private void c_delafter1(EditLine *el) { wchar_t *cp; @@ -160,7 +160,7 @@ c_delafter1(EditLine *el) /* c_delbefore(): * Delete num characters before the cursor */ -protected void +libedit_private void c_delbefore(EditLine *el, int num) { @@ -188,7 +188,7 @@ c_delbefore(EditLine *el, int num) /* c_delbefore1(): * Delete the character before the cursor, do not yank */ -protected void +libedit_private void c_delbefore1(EditLine *el) { wchar_t *cp; @@ -203,7 +203,7 @@ c_delbefore1(EditLine *el) /* ce__isword(): * Return if p is part of a word according to emacs */ -protected int +libedit_private int ce__isword(wint_t p) { return iswalnum(p) || wcschr(L"*?_-.[]~=", p) != NULL; @@ -213,7 +213,7 @@ ce__isword(wint_t p) /* cv__isword(): * Return if p is part of a word according to vi */ -protected int +libedit_private int cv__isword(wint_t p) { if (iswalnum(p) || p == L'_') @@ -227,7 +227,7 @@ cv__isword(wint_t p) /* cv__isWord(): * Return if p is part of a big word according to vi */ -protected int +libedit_private int cv__isWord(wint_t p) { return !iswspace(p); @@ -237,7 +237,7 @@ cv__isWord(wint_t p) /* c__prev_word(): *
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:46:56 UTC 2016 Modified Files: src/lib/libedit: chared.c chared.h chartype.c chartype.h common.c el.c el.h emacs.c hist.c hist.h keymacro.c keymacro.h makelist map.c map.h parse.c parse.h prompt.c prompt.h read.c read.h refresh.c refresh.h search.c search.h sig.c sig.h sys.h terminal.c terminal.h tty.c tty.h vi.c Log Message: s/protected/libedit_private/g To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/lib/libedit/chared.c cvs rdiff -u -r1.28 -r1.29 src/lib/libedit/chared.h src/lib/libedit/hist.c \ src/lib/libedit/makelist cvs rdiff -u -r1.29 -r1.30 src/lib/libedit/chartype.c cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/chartype.h cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/common.c cvs rdiff -u -r1.90 -r1.91 src/lib/libedit/el.c cvs rdiff -u -r1.39 -r1.40 src/lib/libedit/el.h src/lib/libedit/parse.c cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/emacs.c cvs rdiff -u -r1.21 -r1.22 src/lib/libedit/hist.h src/lib/libedit/keymacro.c cvs rdiff -u -r1.5 -r1.6 src/lib/libedit/keymacro.h cvs rdiff -u -r1.50 -r1.51 src/lib/libedit/map.c src/lib/libedit/refresh.c cvs rdiff -u -r1.12 -r1.13 src/lib/libedit/map.h cvs rdiff -u -r1.8 -r1.9 src/lib/libedit/parse.h src/lib/libedit/terminal.h cvs rdiff -u -r1.25 -r1.26 src/lib/libedit/prompt.c src/lib/libedit/sig.c cvs rdiff -u -r1.14 -r1.15 src/lib/libedit/prompt.h cvs rdiff -u -r1.95 -r1.96 src/lib/libedit/read.c cvs rdiff -u -r1.10 -r1.11 src/lib/libedit/read.h src/lib/libedit/sig.h cvs rdiff -u -r1.9 -r1.10 src/lib/libedit/refresh.h cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/search.c cvs rdiff -u -r1.13 -r1.14 src/lib/libedit/search.h cvs rdiff -u -r1.26 -r1.27 src/lib/libedit/sys.h cvs rdiff -u -r1.31 -r1.32 src/lib/libedit/terminal.c cvs rdiff -u -r1.64 -r1.65 src/lib/libedit/tty.c cvs rdiff -u -r1.20 -r1.21 src/lib/libedit/tty.h cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:38:27 UTC 2016 Modified Files: src/lib/libedit: Makefile sys.h Removed Files: src/lib/libedit: editline.c Log Message: Instead of compiling all the source files together in one big file, use protected visibility to achieve the same effect. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/Makefile cvs rdiff -u -r1.1 -r0 src/lib/libedit/editline.c cvs rdiff -u -r1.25 -r1.26 src/lib/libedit/sys.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:38:27 UTC 2016 Modified Files: src/lib/libedit: Makefile sys.h Removed Files: src/lib/libedit: editline.c Log Message: Instead of compiling all the source files together in one big file, use protected visibility to achieve the same effect. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/Makefile cvs rdiff -u -r1.1 -r0 src/lib/libedit/editline.c cvs rdiff -u -r1.25 -r1.26 src/lib/libedit/sys.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/Makefile diff -u src/lib/libedit/Makefile:1.61 src/lib/libedit/Makefile:1.62 --- src/lib/libedit/Makefile:1.61 Mon May 2 10:12:09 2016 +++ src/lib/libedit/Makefile Mon May 9 17:38:27 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.61 2016/05/02 14:12:09 wiz Exp $ +# $NetBSD: Makefile,v 1.62 2016/05/09 21:38:27 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 USE_SHLIBDIR= yes @@ -14,9 +14,10 @@ COPTS+= -Wunused-parameter CWARNFLAGS.gcc+= -Wconversion CWARNFLAGS.clang+= -Wno-cast-qual -OSRCS= chared.c common.c el.c eln.c emacs.c filecomplete.c \ - hist.c keymacro.c map.c chartype.c \ - parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c +SRCS = chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \ + hist.c history.c historyn.c keymacro.c map.c \ + parse.c prompt.c read.c readline.c refresh.c search.c sig.c \ + terminal.c tokenizer.c tokenizern.c tty.c vi.c MAN= editline.3 editrc.5 editline.7 @@ -64,13 +65,6 @@ editline.3 tok_wline.3 \ editline.3 tok_wreset.3 \ editline.3 tok_wstr.3 -# For speed and debugging -#SRCS= ${OSRCS} -# For protection -SRCS= editline.c - -SRCS += history.c historyn.c tokenizer.c tokenizern.c readline.c - LIBEDITDIR?=${.CURDIR} INCS= histedit.h Index: src/lib/libedit/sys.h diff -u src/lib/libedit/sys.h:1.25 src/lib/libedit/sys.h:1.26 --- src/lib/libedit/sys.h:1.25 Mon Apr 11 14:56:31 2016 +++ src/lib/libedit/sys.h Mon May 9 17:38:27 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: sys.h,v 1.25 2016/04/11 18:56:31 christos Exp $ */ +/* $NetBSD: sys.h,v 1.26 2016/05/09 21:38:27 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -58,10 +58,8 @@ # endif #endif -#ifndef protected -# define protected /* Redefined from elsewhere to "static" */ - /* When we want to hide everything */ -#endif +/* If your compiler does not support this, define it to be empty. */ +#define protected __attribute__((__visibility__("hidden"))) #ifndef __arraycount # define __arraycount(a) (sizeof(a) / sizeof(*(a)))
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:37:34 UTC 2016 Modified Files: src/lib/libedit: eln.c Log Message: Elide gcc warning about intermediate const casts caused by visibility change. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/eln.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/eln.c diff -u src/lib/libedit/eln.c:1.33 src/lib/libedit/eln.c:1.34 --- src/lib/libedit/eln.c:1.33 Mon Apr 11 14:56:31 2016 +++ src/lib/libedit/eln.c Mon May 9 17:37:34 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.33 2016/04/11 18:56:31 christos Exp $ */ +/* $NetBSD: eln.c,v 1.34 2016/05/09 21:37:34 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.33 2016/04/11 18:56:31 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.34 2016/05/09 21:37:34 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -91,8 +91,7 @@ el_parse(EditLine *el, int argc, const c int ret; const wchar_t **wargv; - wargv = (const wchar_t **) - ct_decode_argv(argc, argv, >el_lgcyconv); + wargv = (void *)ct_decode_argv(argc, argv, >el_lgcyconv); if (!wargv) return -1; ret = el_wparse(el, argc, wargv); @@ -171,8 +170,7 @@ el_set(EditLine *el, int op, ...) if ((argv[i] = va_arg(ap, const char *)) == NULL) break; argv[0] = argv[i] = NULL; - wargv = (const wchar_t **) - ct_decode_argv(i + 1, argv, >el_lgcyconv); + wargv = (void *)ct_decode_argv(i + 1, argv, >el_lgcyconv); if (!wargv) { ret = -1; goto out;
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:27:55 UTC 2016 Modified Files: src/lib/libedit: editline.3 editline.7 readline.c Log Message: GNU readline(3) regards history chronologically, that is, from the perspective of the dawn of time, so "next" means "newer" and "previous" means "older". Libedit, by contrast, uses reverse chronology and regards history from the perspective of the present, such that "next" means "longer ago" and "previous" means "not so long ago". The following patch fixes previous_history() and next_history() as proposed by Bastian Maerkisch. But there is a related problem demonstrated by Bastian's regression tests that his patch did not fix: next_history() can advance not only to the newest entry, but beyond it, which core libedit cannot do. So that feature must be implemented locally in readline.c. With that, the last of Bastians tests is fixed, test_movement_direction(). This patch also improves libedit documentation to more clearly state what "previous" and "next" mean. GNU readline documentation is just as unclear, but we can't easily fix that since libedit doesn't include its own readline.3 manual. (Ingo Schwarze) To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/lib/libedit/editline.3 cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/editline.7 cvs rdiff -u -r1.131 -r1.132 src/lib/libedit/readline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:27:55 UTC 2016 Modified Files: src/lib/libedit: editline.3 editline.7 readline.c Log Message: GNU readline(3) regards history chronologically, that is, from the perspective of the dawn of time, so "next" means "newer" and "previous" means "older". Libedit, by contrast, uses reverse chronology and regards history from the perspective of the present, such that "next" means "longer ago" and "previous" means "not so long ago". The following patch fixes previous_history() and next_history() as proposed by Bastian Maerkisch. But there is a related problem demonstrated by Bastian's regression tests that his patch did not fix: next_history() can advance not only to the newest entry, but beyond it, which core libedit cannot do. So that feature must be implemented locally in readline.c. With that, the last of Bastians tests is fixed, test_movement_direction(). This patch also improves libedit documentation to more clearly state what "previous" and "next" mean. GNU readline documentation is just as unclear, but we can't easily fix that since libedit doesn't include its own readline.3 manual. (Ingo Schwarze) To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/lib/libedit/editline.3 cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/editline.7 cvs rdiff -u -r1.131 -r1.132 src/lib/libedit/readline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/editline.3 diff -u src/lib/libedit/editline.3:1.89 src/lib/libedit/editline.3:1.90 --- src/lib/libedit/editline.3:1.89 Thu Apr 28 11:50:33 2016 +++ src/lib/libedit/editline.3 Mon May 9 17:27:55 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.89 2016/04/28 15:50:33 christos Exp $ +.\" $NetBSD: editline.3,v 1.90 2016/05/09 21:27:55 christos Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 24, 2016 +.Dd May 9, 2016 .Dt EDITLINE 3 .Os .Sh NAME @@ -761,8 +761,10 @@ Return the first element in the history. Return the last element in the history. .It Dv H_PREV Return the previous element in the history. +It is newer than the current one. .It Dv H_NEXT Return the next element in the history. +It is older than the current one. .It Dv H_CURR Return the current element in the history. .It Dv H_SET Index: src/lib/libedit/editline.7 diff -u src/lib/libedit/editline.7:1.4 src/lib/libedit/editline.7:1.5 --- src/lib/libedit/editline.7:1.4 Mon May 2 08:51:25 2016 +++ src/lib/libedit/editline.7 Mon May 9 17:27:55 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.7,v 1.4 2016/05/02 12:51:25 wiz Exp $ +.\" $NetBSD: editline.7,v 1.5 2016/05/09 21:27:55 christos Exp $ .\" $OpenBSD: editline.7,v 1.1 2016/04/20 01:11:45 schwarze Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze@@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd May 2, 2016 +.Dd May 7, 2016 .Dt EDITLINE 7 .Os .Sh NAME @@ -408,6 +408,7 @@ It is an error if the cursor is already buffer. .It Ic ed-next-history Pq vi command: j, +, Ctrl-N; emacs: Ctrl-N Replace the edit buffer with the next history line. +That line is older than the current line. With an argument, go forward by that number of history lines. It is a non-fatal error to advance by more lines than are available. .It Ic ed-next-line Pq not bound by default @@ -427,6 +428,7 @@ It is an error if the cursor is already edit buffer. .It Ic ed-prev-history Pq vi command: k, -, Ctrl-P; emacs: Ctrl-P Replace the edit buffer with the previous history line. +That line is newer than the current line. With an argument, go back by that number of lines. It is a non-fatal error to back up by more lines than are available. .It Ic ed-prev-line Pq not bound by default Index: src/lib/libedit/readline.c diff -u src/lib/libedit/readline.c:1.131 src/lib/libedit/readline.c:1.132 --- src/lib/libedit/readline.c:1.131 Mon May 9 17:25:11 2016 +++ src/lib/libedit/readline.c Mon May 9 17:27:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.131 2016/05/09 21:25:11 christos Exp $ */ +/* $NetBSD: readline.c,v 1.132 2016/05/09 21:27:55 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.131 2016/05/09 21:25:11 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.132 2016/05/09 21:27:55 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -156,6 +156,14 @@ char *rl_special_prefixes = NULL; */ int rl_completion_append_character = ' '; +/* + * When the history cursor is on the newest
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:25:11 UTC 2016 Modified Files: src/lib/libedit: readline.c Log Message: The libedit implementation of history_get() also differs from the GNU implementation: libedit goes to the entry with the given number stored in the HistEvent structure, while GNU subtracts history_base, then advances that many entries from the oldest one. If entries were removed in between, GNU advances further than libedit. The call sequence H_CURR, H_DELDATA, H_CURR, H_NEXT_EVDATA looks weird, as if part of that must somehow be redundant. But actually, the user interface is so counter-intuitive that every single step is really required. - The first H_CURR is needed to be able to go back after an error. - The H_DELDATA is needed to move the cursor. Even though it takes a pointer to ev, that structure is not filled in when the call succeeds. H_DELDATA only moves the cursor, it doesn't tell us the new event number. - Consequently, the second H_CURR is required to get ev.num filled in. But it doesn't return the data because ev has no field for that. - So even though the cursor is already positioned correctly, H_NEXT_EVDATA is needed as the final step merely to get the data. (Ingo Schwarze) To generate a diff of this commit: cvs rdiff -u -r1.130 -r1.131 src/lib/libedit/readline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/readline.c diff -u src/lib/libedit/readline.c:1.130 src/lib/libedit/readline.c:1.131 --- src/lib/libedit/readline.c:1.130 Sun May 8 16:15:00 2016 +++ src/lib/libedit/readline.c Mon May 9 17:25:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.130 2016/05/08 20:15:00 christos Exp $ */ +/* $NetBSD: readline.c,v 1.131 2016/05/09 21:25:11 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.130 2016/05/08 20:15:00 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.131 2016/05/09 21:25:11 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -1400,25 +1400,37 @@ history_get(int num) if (h == NULL || e == NULL) rl_initialize(); + if (num < history_base) + return NULL; + /* save current position */ if (history(h, , H_CURR) != 0) return NULL; curr_num = ev.num; - /* start from the oldest */ - if (history(h, , H_LAST) != 0) - return NULL; /* error */ - - /* look forwards for event matching specified offset */ - if (history(h, , H_NEXT_EVDATA, num, )) - return NULL; + /* + * use H_DELDATA to set to nth history (without delete) by passing + * (void **)-1 -- as in history_set_pos + */ + if (history(h, , H_DELDATA, num - history_base, (void **)-1) != 0) + goto out; + /* get current entry */ + if (history(h, , H_CURR) != 0) + goto out; + if (history(h, , H_NEXT_EVDATA, ev.num, ) != 0) + goto out; she.line = ev.str; /* restore pointer to where it was */ (void)history(h, , H_SET, curr_num); return + +out: + /* restore pointer to where it was */ + (void)history(h, , H_SET, curr_num); + return NULL; }
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon May 9 21:25:11 UTC 2016 Modified Files: src/lib/libedit: readline.c Log Message: The libedit implementation of history_get() also differs from the GNU implementation: libedit goes to the entry with the given number stored in the HistEvent structure, while GNU subtracts history_base, then advances that many entries from the oldest one. If entries were removed in between, GNU advances further than libedit. The call sequence H_CURR, H_DELDATA, H_CURR, H_NEXT_EVDATA looks weird, as if part of that must somehow be redundant. But actually, the user interface is so counter-intuitive that every single step is really required. - The first H_CURR is needed to be able to go back after an error. - The H_DELDATA is needed to move the cursor. Even though it takes a pointer to ev, that structure is not filled in when the call succeeds. H_DELDATA only moves the cursor, it doesn't tell us the new event number. - Consequently, the second H_CURR is required to get ev.num filled in. But it doesn't return the data because ev has no field for that. - So even though the cursor is already positioned correctly, H_NEXT_EVDATA is needed as the final step merely to get the data. (Ingo Schwarze) To generate a diff of this commit: cvs rdiff -u -r1.130 -r1.131 src/lib/libedit/readline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 21:03:10 UTC 2016 Modified Files: src/bin/sh: eval.c eval.h main.c Log Message: PR bin/48875 - avoid holding (replaced) file descriptors open when running a command in the current shell (so they can be restored for the next command) in cases where it is obvious that there is not going to be a following command to use them. This fixes the problem reported in the PR (though there are still plenty of situations where a FD could be closed but isn't, we do not do full fd flow eveluation to determine whether a fd will be used or not). This is the change that was just committed and then backed out again... OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125 src/bin/sh/eval.c cvs rdiff -u -r1.18 -r1.19 src/bin/sh/eval.h cvs rdiff -u -r1.66 -r1.67 src/bin/sh/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 21:03:10 UTC 2016 Modified Files: src/bin/sh: eval.c eval.h main.c Log Message: PR bin/48875 - avoid holding (replaced) file descriptors open when running a command in the current shell (so they can be restored for the next command) in cases where it is obvious that there is not going to be a following command to use them. This fixes the problem reported in the PR (though there are still plenty of situations where a FD could be closed but isn't, we do not do full fd flow eveluation to determine whether a fd will be used or not). This is the change that was just committed and then backed out again... OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125 src/bin/sh/eval.c cvs rdiff -u -r1.18 -r1.19 src/bin/sh/eval.h cvs rdiff -u -r1.66 -r1.67 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/eval.c diff -u src/bin/sh/eval.c:1.124 src/bin/sh/eval.c:1.125 --- src/bin/sh/eval.c:1.124 Mon May 9 20:55:51 2016 +++ src/bin/sh/eval.c Mon May 9 21:03:10 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.124 2016/05/09 20:55:51 kre Exp $ */ +/* $NetBSD: eval.c,v 1.125 2016/05/09 21:03:10 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: eval.c,v 1.124 2016/05/09 20:55:51 kre Exp $"); +__RCSID("$NetBSD: eval.c,v 1.125 2016/05/09 21:03:10 kre Exp $"); #endif #endif /* not lint */ @@ -219,7 +219,7 @@ evalstring(char *s, int flag) while ((n = parsecmd(0)) != NEOF) { TRACE(("evalstring: "); showtree(n)); if (nflag == 0) - evaltree(n, flag); + evaltree(n, flag | EV_MORE); popstackmark(); } popfile(); @@ -257,19 +257,20 @@ evaltree(union node *n, int flags) #endif switch (n->type) { case NSEMI: - evaltree(n->nbinary.ch1, flags & EV_TESTED); + evaltree(n->nbinary.ch1, (flags & EV_TESTED) | + (n->nbinary.ch2 ? EV_MORE : 0)); if (nflag || evalskip) goto out; evaltree(n->nbinary.ch2, flags); break; case NAND: - evaltree(n->nbinary.ch1, EV_TESTED); + evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); if (nflag || evalskip || exitstatus != 0) goto out; evaltree(n->nbinary.ch2, flags); break; case NOR: - evaltree(n->nbinary.ch1, EV_TESTED); + evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); if (nflag || evalskip || exitstatus == 0) goto out; evaltree(n->nbinary.ch2, flags); @@ -281,14 +282,14 @@ evaltree(union node *n, int flags) popredir(); break; case NSUBSHELL: - evalsubshell(n, flags); + evalsubshell(n, flags & ~EV_MORE); do_etest = !(flags & EV_TESTED); break; case NBACKGND: - evalsubshell(n, flags); + evalsubshell(n, flags & ~EV_MORE); break; case NIF: { - evaltree(n->nif.test, EV_TESTED); + evaltree(n->nif.test, EV_TESTED | EV_MORE); if (nflag || evalskip) goto out; if (exitstatus == 0) @@ -314,7 +315,7 @@ evaltree(union node *n, int flags) exitstatus = 0; break; case NNOT: - evaltree(n->nnot.com, EV_TESTED); + evaltree(n->nnot.com, (flags & EV_MORE) | EV_TESTED); exitstatus = !exitstatus; break; case NPIPE: @@ -360,7 +361,7 @@ evalloop(union node *n, int flags) TRACE(("evalloop done\n")); for (;;) { - evaltree(n->nbinary.ch1, EV_TESTED); + evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); if (nflag) break; if (evalskip) { @@ -379,7 +380,7 @@ skipping: if (evalskip == SKIPCONT && if (exitstatus == 0) break; } - evaltree(n->nbinary.ch2, flags & EV_TESTED); + evaltree(n->nbinary.ch2, flags & (EV_TESTED | EV_MORE)); status = exitstatus; if (evalskip) goto skipping; @@ -413,7 +414,7 @@ evalfor(union node *n, int flags) loopnest++; for (sp = arglist.list ; sp ; sp = sp->next) { setvar(n->nfor.var, sp->text, 0); - evaltree(n->nfor.body, flags & EV_TESTED); + evaltree(n->nfor.body, flags & (EV_TESTED | EV_MORE)); status = exitstatus; if (nflag) break; @@ -881,6 +882,8 @@ evalcommand(union node *cmd, int flgs, s INTOFF; jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; + if (mode) + flags &= ~EV_MORE; if (flags & EV_BACKCMD) { mode = FORK_NOJOB; if (sh_pipe(pip) < 0) @@ -967,7 +970,7 @@ normal_fork: #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect, REDIR_PUSH); + redirect(cmd->ncmd.redirect, flags & EV_MORE ? REDIR_PUSH : 0); saveparam = shellparam; shellparam.malloc = 0; shellparam.reset = 1; @@ -1005,7 +1008,8 @@ normal_fork: freeparam(); shellparam = saveparam; handler = savehandler; - popredir(); + if (flags & EV_MORE) + popredir(); INTON; if (evalskip == SKIPFUNC) { evalskip = SKIPNONE; Index: src/bin/sh/eval.h diff -u src/bin/sh/eval.h:1.18 src/bin/sh/eval.h:1.19 --- src/bin/sh/eval.h:1.18 Mon May 9 20:55:51 2016 +++
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 20:55:51 UTC 2016 Modified Files: src/bin/sh: eval.c eval.h main.c Log Message: Revert previous. These changes are intended to get made (and will be in a minute or two) but not as part of that commit... The log entry certainly does not apply. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/bin/sh/eval.c cvs rdiff -u -r1.17 -r1.18 src/bin/sh/eval.h cvs rdiff -u -r1.65 -r1.66 src/bin/sh/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 20:55:51 UTC 2016 Modified Files: src/bin/sh: eval.c eval.h main.c Log Message: Revert previous. These changes are intended to get made (and will be in a minute or two) but not as part of that commit... The log entry certainly does not apply. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/bin/sh/eval.c cvs rdiff -u -r1.17 -r1.18 src/bin/sh/eval.h cvs rdiff -u -r1.65 -r1.66 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/eval.c diff -u src/bin/sh/eval.c:1.123 src/bin/sh/eval.c:1.124 --- src/bin/sh/eval.c:1.123 Mon May 9 20:50:08 2016 +++ src/bin/sh/eval.c Mon May 9 20:55:51 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.123 2016/05/09 20:50:08 kre Exp $ */ +/* $NetBSD: eval.c,v 1.124 2016/05/09 20:55:51 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: eval.c,v 1.123 2016/05/09 20:50:08 kre Exp $"); +__RCSID("$NetBSD: eval.c,v 1.124 2016/05/09 20:55:51 kre Exp $"); #endif #endif /* not lint */ @@ -219,7 +219,7 @@ evalstring(char *s, int flag) while ((n = parsecmd(0)) != NEOF) { TRACE(("evalstring: "); showtree(n)); if (nflag == 0) - evaltree(n, flag | EV_MORE); + evaltree(n, flag); popstackmark(); } popfile(); @@ -257,20 +257,19 @@ evaltree(union node *n, int flags) #endif switch (n->type) { case NSEMI: - evaltree(n->nbinary.ch1, (flags & EV_TESTED) | - (n->nbinary.ch2 ? EV_MORE : 0)); + evaltree(n->nbinary.ch1, flags & EV_TESTED); if (nflag || evalskip) goto out; evaltree(n->nbinary.ch2, flags); break; case NAND: - evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); + evaltree(n->nbinary.ch1, EV_TESTED); if (nflag || evalskip || exitstatus != 0) goto out; evaltree(n->nbinary.ch2, flags); break; case NOR: - evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); + evaltree(n->nbinary.ch1, EV_TESTED); if (nflag || evalskip || exitstatus == 0) goto out; evaltree(n->nbinary.ch2, flags); @@ -282,14 +281,14 @@ evaltree(union node *n, int flags) popredir(); break; case NSUBSHELL: - evalsubshell(n, flags & ~EV_MORE); + evalsubshell(n, flags); do_etest = !(flags & EV_TESTED); break; case NBACKGND: - evalsubshell(n, flags & ~EV_MORE); + evalsubshell(n, flags); break; case NIF: { - evaltree(n->nif.test, EV_TESTED | EV_MORE); + evaltree(n->nif.test, EV_TESTED); if (nflag || evalskip) goto out; if (exitstatus == 0) @@ -315,7 +314,7 @@ evaltree(union node *n, int flags) exitstatus = 0; break; case NNOT: - evaltree(n->nnot.com, (flags & EV_MORE) | EV_TESTED); + evaltree(n->nnot.com, EV_TESTED); exitstatus = !exitstatus; break; case NPIPE: @@ -361,7 +360,7 @@ evalloop(union node *n, int flags) TRACE(("evalloop done\n")); for (;;) { - evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); + evaltree(n->nbinary.ch1, EV_TESTED); if (nflag) break; if (evalskip) { @@ -380,7 +379,7 @@ skipping: if (evalskip == SKIPCONT && if (exitstatus == 0) break; } - evaltree(n->nbinary.ch2, flags & (EV_TESTED | EV_MORE)); + evaltree(n->nbinary.ch2, flags & EV_TESTED); status = exitstatus; if (evalskip) goto skipping; @@ -414,7 +413,7 @@ evalfor(union node *n, int flags) loopnest++; for (sp = arglist.list ; sp ; sp = sp->next) { setvar(n->nfor.var, sp->text, 0); - evaltree(n->nfor.body, flags & (EV_TESTED | EV_MORE)); + evaltree(n->nfor.body, flags & EV_TESTED); status = exitstatus; if (nflag) break; @@ -882,8 +881,6 @@ evalcommand(union node *cmd, int flgs, s INTOFF; jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; - if (mode) - flags &= ~EV_MORE; if (flags & EV_BACKCMD) { mode = FORK_NOJOB; if (sh_pipe(pip) < 0) @@ -970,7 +967,7 @@ normal_fork: #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect, flags & EV_MORE ? REDIR_PUSH : 0); + redirect(cmd->ncmd.redirect, REDIR_PUSH); saveparam = shellparam; shellparam.malloc = 0; shellparam.reset = 1; @@ -1008,8 +1005,7 @@ normal_fork: freeparam(); shellparam = saveparam; handler = savehandler; - if (flags & EV_MORE) - popredir(); + popredir(); INTON; if (evalskip == SKIPFUNC) { evalskip = SKIPNONE; Index: src/bin/sh/eval.h diff -u src/bin/sh/eval.h:1.17 src/bin/sh/eval.h:1.18 --- src/bin/sh/eval.h:1.17 Mon May 9 20:50:08 2016 +++ src/bin/sh/eval.h Mon May 9 20:55:51 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.h,v 1.17 2016/05/09 20:50:08 kre Exp $ */ +/* $NetBSD: eval.h,v 1.18 2016/05/09 20:55:51 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -71,9 +71,3 @@ void stop_skipping(void); /* reset inter * Only for use by reset() in init.c! */ void reset_eval(void); - -/* flags in argument to evaltree
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 20:50:08 UTC 2016 Modified Files: src/bin/sh: eval.c eval.h main.c redir.c Log Message: Finish the fd reassignment fixes from 1.43 and 1.45 ... if we are moving a fd to an unspecified high fd number, we certainly do not want to hand that high fd off to other processes after an exec, so always set close-on-exec on the result (even if lack of fd's means no fd alteration happens.) This will (eventually) allow some other code that sets close-on-exec to be removed, but for now, doing it twice won't hurt. Also, in a N> type redirection, do not set close-on-exec if we don't want it. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/bin/sh/eval.c cvs rdiff -u -r1.16 -r1.17 src/bin/sh/eval.h cvs rdiff -u -r1.64 -r1.65 src/bin/sh/main.c cvs rdiff -u -r1.45 -r1.46 src/bin/sh/redir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 20:50:08 UTC 2016 Modified Files: src/bin/sh: eval.c eval.h main.c redir.c Log Message: Finish the fd reassignment fixes from 1.43 and 1.45 ... if we are moving a fd to an unspecified high fd number, we certainly do not want to hand that high fd off to other processes after an exec, so always set close-on-exec on the result (even if lack of fd's means no fd alteration happens.) This will (eventually) allow some other code that sets close-on-exec to be removed, but for now, doing it twice won't hurt. Also, in a N> type redirection, do not set close-on-exec if we don't want it. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/bin/sh/eval.c cvs rdiff -u -r1.16 -r1.17 src/bin/sh/eval.h cvs rdiff -u -r1.64 -r1.65 src/bin/sh/main.c cvs rdiff -u -r1.45 -r1.46 src/bin/sh/redir.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/eval.c diff -u src/bin/sh/eval.c:1.122 src/bin/sh/eval.c:1.123 --- src/bin/sh/eval.c:1.122 Tue May 3 13:47:58 2016 +++ src/bin/sh/eval.c Mon May 9 20:50:08 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.122 2016/05/03 13:47:58 kre Exp $ */ +/* $NetBSD: eval.c,v 1.123 2016/05/09 20:50:08 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: eval.c,v 1.122 2016/05/03 13:47:58 kre Exp $"); +__RCSID("$NetBSD: eval.c,v 1.123 2016/05/09 20:50:08 kre Exp $"); #endif #endif /* not lint */ @@ -86,11 +86,6 @@ __RCSID("$NetBSD: eval.c,v 1.122 2016/05 #endif -/* flags in argument to evaltree */ -#define EV_EXIT 01 /* exit after evaluating tree */ -#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ -#define EV_BACKCMD 04 /* command executing within back quotes */ - STATIC enum skipstate evalskip; /* != SKIPNONE if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ STATIC int loopnest; /* current loop nesting level */ @@ -224,7 +219,7 @@ evalstring(char *s, int flag) while ((n = parsecmd(0)) != NEOF) { TRACE(("evalstring: "); showtree(n)); if (nflag == 0) - evaltree(n, flag); + evaltree(n, flag | EV_MORE); popstackmark(); } popfile(); @@ -262,19 +257,20 @@ evaltree(union node *n, int flags) #endif switch (n->type) { case NSEMI: - evaltree(n->nbinary.ch1, flags & EV_TESTED); + evaltree(n->nbinary.ch1, (flags & EV_TESTED) | + (n->nbinary.ch2 ? EV_MORE : 0)); if (nflag || evalskip) goto out; evaltree(n->nbinary.ch2, flags); break; case NAND: - evaltree(n->nbinary.ch1, EV_TESTED); + evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); if (nflag || evalskip || exitstatus != 0) goto out; evaltree(n->nbinary.ch2, flags); break; case NOR: - evaltree(n->nbinary.ch1, EV_TESTED); + evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); if (nflag || evalskip || exitstatus == 0) goto out; evaltree(n->nbinary.ch2, flags); @@ -286,14 +282,14 @@ evaltree(union node *n, int flags) popredir(); break; case NSUBSHELL: - evalsubshell(n, flags); + evalsubshell(n, flags & ~EV_MORE); do_etest = !(flags & EV_TESTED); break; case NBACKGND: - evalsubshell(n, flags); + evalsubshell(n, flags & ~EV_MORE); break; case NIF: { - evaltree(n->nif.test, EV_TESTED); + evaltree(n->nif.test, EV_TESTED | EV_MORE); if (nflag || evalskip) goto out; if (exitstatus == 0) @@ -319,7 +315,7 @@ evaltree(union node *n, int flags) exitstatus = 0; break; case NNOT: - evaltree(n->nnot.com, EV_TESTED); + evaltree(n->nnot.com, (flags & EV_MORE) | EV_TESTED); exitstatus = !exitstatus; break; case NPIPE: @@ -365,7 +361,7 @@ evalloop(union node *n, int flags) TRACE(("evalloop done\n")); for (;;) { - evaltree(n->nbinary.ch1, EV_TESTED); + evaltree(n->nbinary.ch1, EV_TESTED | EV_MORE); if (nflag) break; if (evalskip) { @@ -384,7 +380,7 @@ skipping: if (evalskip == SKIPCONT && if (exitstatus == 0) break; } - evaltree(n->nbinary.ch2, flags & EV_TESTED); + evaltree(n->nbinary.ch2, flags & (EV_TESTED | EV_MORE)); status = exitstatus; if (evalskip) goto skipping; @@ -418,7 +414,7 @@ evalfor(union node *n, int flags) loopnest++; for (sp = arglist.list ; sp ; sp = sp->next) { setvar(n->nfor.var, sp->text, 0); - evaltree(n->nfor.body, flags & EV_TESTED); + evaltree(n->nfor.body, flags & (EV_TESTED | EV_MORE)); status = exitstatus; if (nflag) break; @@ -886,6 +882,8 @@ evalcommand(union node *cmd, int flgs, s INTOFF; jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; + if (mode) + flags &= ~EV_MORE; if (flags & EV_BACKCMD) { mode = FORK_NOJOB; if (sh_pipe(pip) < 0) @@ -972,7 +970,7 @@ normal_fork: #ifdef DEBUG trputs("Shell function: "); trargs(argv); #endif - redirect(cmd->ncmd.redirect,
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 20:36:07 UTC 2016 Modified Files: src/bin/sh: parser.c sh.1 Log Message: PR bin/48489 -- Shell "simple commands" are now not allowed to be completely empty, they must have something (var assignment, redirect, or command, or multiple of those) to avoid a syntax error. This matches the requirements of the grammar in the standard. Correct the parser (using FreeBSD's sh as a guide) and update the man page to remove text that noted a couple of places this was previously OK. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.118 -r1.119 src/bin/sh/parser.c cvs rdiff -u -r1.121 -r1.122 src/bin/sh/sh.1 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/parser.c diff -u src/bin/sh/parser.c:1.118 src/bin/sh/parser.c:1.119 --- src/bin/sh/parser.c:1.118 Tue May 3 03:16:55 2016 +++ src/bin/sh/parser.c Mon May 9 20:36:07 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: parser.c,v 1.118 2016/05/03 03:16:55 kre Exp $ */ +/* $NetBSD: parser.c,v 1.119 2016/05/09 20:36:07 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; #else -__RCSID("$NetBSD: parser.c,v 1.118 2016/05/03 03:16:55 kre Exp $"); +__RCSID("$NetBSD: parser.c,v 1.119 2016/05/09 20:36:07 kre Exp $"); #endif #endif /* not lint */ @@ -498,20 +498,32 @@ TRACE(("expecting DO got %s %s\n", tokna synexpect(TEND, 0); checkkwd = 1; break; - /* Handle an empty command like other simple commands. */ + case TSEMI: - /* - * An empty command before a ; doesn't make much sense, and - * should certainly be disallowed in the case of `if ;'. - */ - if (!redir) - synexpect(-1, 0); case TAND: case TOR: + case TPIPE: case TNL: case TEOF: - case TWORD: case TRP: + /* + * simple commands must have something in them, + * either a word (which at this point includes a=b) + * or a redirection. If we reached the end of the + * command (which one of these tokens indicates) + * when we are just starting, and have not had a + * redirect, then ... + * + * nb: it is still possible to end up with empty + * simple commands, if the "command" is a var + * expansion that produces nothing + * X= ; $X && $X + * --> && + * I am not sure if this is intended to be legal or not. + */ + if (!redir) + synexpect(-1, 0); + case TWORD: tokpushback++; n1 = simplecmd(rpp, redir); goto checkneg; Index: src/bin/sh/sh.1 diff -u src/bin/sh/sh.1:1.121 src/bin/sh/sh.1:1.122 --- src/bin/sh/sh.1:1.121 Mon Apr 4 13:05:56 2016 +++ src/bin/sh/sh.1 Mon May 9 20:36:07 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: sh.1,v 1.121 2016/04/04 13:05:56 wiz Exp $ +.\" $NetBSD: sh.1,v 1.122 2016/05/09 20:36:07 kre Exp $ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -31,7 +31,7 @@ .\" .\" @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" -.Dd March 31, 2016 +.Dd May 9, 2016 .Dt SH 1 .ds flags abCEeFfhnuvxIimpqV .Os @@ -330,11 +330,9 @@ in which case altering the flag has no effect. .It Fl h Em trackall Bind commands in functions to file system paths when the function is defined. -.\" They can seek me here (that dreaded filesystem) When off, the file system is searched for commands each time the function is invoked. (Not implemented.) -.\" then can seek me there (the filesystem, once again) .It Fl p Em nopriv Do not attempt to reset effective uid if it does not match uid. This is not set by default to help avoid incorrect usage by setuid @@ -589,7 +587,6 @@ new process. Otherwise, if the command name doesn't match a function or built-in, the command is searched for as a normal program in the file system (as described in the next section). -.\" But the damned elusive filesystem shall never be defeated! When a normal program is executed, the shell runs the program, passing the arguments and the environment to the program. If the program is not a normal executable file (i.e., if it does @@ -757,14 +754,6 @@ writes .Dq baz and nothing else. This is not the way it works in C. -Also, if you forget the left-hand side (for example when continuing lines but -forgetting to use a backslash) it defaults to a true statement. -This behavior is not useful and should not be relied upon. -Similarly, if input to the -.Nm -reaches end of file immediately after one of these operators, -it is assumed that a true statement follows. -This behavior is also not useful and should not be relied upon. .Ss Flow-Control Constructs -- if, while, for, case The syntax of the if command is .Bd -literal -offset indent
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Mon May 9 20:36:07 UTC 2016 Modified Files: src/bin/sh: parser.c sh.1 Log Message: PR bin/48489 -- Shell "simple commands" are now not allowed to be completely empty, they must have something (var assignment, redirect, or command, or multiple of those) to avoid a syntax error. This matches the requirements of the grammar in the standard. Correct the parser (using FreeBSD's sh as a guide) and update the man page to remove text that noted a couple of places this was previously OK. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.118 -r1.119 src/bin/sh/parser.c cvs rdiff -u -r1.121 -r1.122 src/bin/sh/sh.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: martin Date: Mon May 9 20:28:08 UTC 2016 Modified Files: src/external/bsd/dhcpcd/dist: dhcp.c Log Message: Avoid a "conversion to '__uint16_t' from 'int' may alter its value" error on some architectures (like m68k). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/external/bsd/dhcpcd/dist/dhcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: martin Date: Mon May 9 20:28:08 UTC 2016 Modified Files: src/external/bsd/dhcpcd/dist: dhcp.c Log Message: Avoid a "conversion to '__uint16_t' from 'int' may alter its value" error on some architectures (like m68k). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/external/bsd/dhcpcd/dist/dhcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcpcd/dist/dhcp.c diff -u src/external/bsd/dhcpcd/dist/dhcp.c:1.40 src/external/bsd/dhcpcd/dist/dhcp.c:1.41 --- src/external/bsd/dhcpcd/dist/dhcp.c:1.40 Mon May 9 10:15:59 2016 +++ src/external/bsd/dhcpcd/dist/dhcp.c Mon May 9 20:28:08 2016 @@ -1,5 +1,5 @@ #include - __RCSID("$NetBSD: dhcp.c,v 1.40 2016/05/09 10:15:59 roy Exp $"); + __RCSID("$NetBSD: dhcp.c,v 1.41 2016/05/09 20:28:08 martin Exp $"); /* * dhcpcd - DHCP client daemon @@ -890,7 +890,7 @@ make_message(struct bootp **bootpm, cons AREA_CHECK(2); *p++ = DHO_MAXMESSAGESIZE; *p++ = 2; - sz = htons((uint16_t)mtu - IP_UDP_SIZE); + sz = htons((uint16_t)(mtu - IP_UDP_SIZE)); memcpy(p, , 2); p += 2; }
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Mon May 9 19:50:05 UTC 2016 Modified Files: src/doc [netbsd-7]: CHANGES-7.1 Log Message: 1161-1163 To generate a diff of this commit: cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-7.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: snj Date: Mon May 9 19:50:05 UTC 2016 Modified Files: src/doc [netbsd-7]: CHANGES-7.1 Log Message: 1161-1163 To generate a diff of this commit: cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-7.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.1 diff -u src/doc/CHANGES-7.1:1.1.2.83 src/doc/CHANGES-7.1:1.1.2.84 --- src/doc/CHANGES-7.1:1.1.2.83 Wed May 4 22:52:13 2016 +++ src/doc/CHANGES-7.1 Mon May 9 19:50:05 2016 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.1,v 1.1.2.83 2016/05/04 22:52:13 snj Exp $ +# $NetBSD: CHANGES-7.1,v 1.1.2.84 2016/05/09 19:50:05 snj Exp $ A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1 release: @@ -4214,3 +4214,27 @@ doc/3RDPARTY patch Update OpenSSL to 1.0.1t. [spz, ticket #1165] +lib/libc/stdlib/jemalloc.c 1.40 + + PR lib/50791: Instead of using sorting the arena chunks by + address only, sort by size of the longest run and address + as tie break. Avoids long linear searches for code heavy + on medium sized allocations. + [joerg, ticket #1161] + +sys/rump/librump/rumpkern/rump.c 1.329 + + Align the message buffer. The kernel routines normally are + used only with page aligned buffers and they assume at least + pointer alignment. Be defensive here and align to 256 Bytes. + [joerg, ticket #1162] + +sys/fs/tmpfs/tmpfs_vfsops.c 1.66, 1.67 +sys/fs/tmpfs/tmpfs_vnops.c 1.124 + + Only recheck size/node limits on update mounts if they + actually have been specified. + + Implement most of mount -ur functionality for tmpfs. + [joerg, ticket #1163] +
CVS commit: [netbsd-7] src/sys/fs/tmpfs
Module Name:src Committed By: snj Date: Mon May 9 19:45:00 UTC 2016 Modified Files: src/sys/fs/tmpfs [netbsd-7]: tmpfs_vfsops.c tmpfs_vnops.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1163): sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.66, 1.67 sys/fs/tmpfs/tmpfs_vnops.c: revision 1.124 Only recheck size/node limits on update mounts, if there actually have been specified. -- Implement most of mount -ur functionality for tmpfs. Remaining issue is the question who is responsible for syncing pending writes, but the functionality is good enough for serving as read-only chroot base in bulk builds. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.63.2.1 src/sys/fs/tmpfs/tmpfs_vfsops.c cvs rdiff -u -r1.120.2.1 -r1.120.2.2 src/sys/fs/tmpfs/tmpfs_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/sys/fs/tmpfs
Module Name:src Committed By: snj Date: Mon May 9 19:45:00 UTC 2016 Modified Files: src/sys/fs/tmpfs [netbsd-7]: tmpfs_vfsops.c tmpfs_vnops.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1163): sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.66, 1.67 sys/fs/tmpfs/tmpfs_vnops.c: revision 1.124 Only recheck size/node limits on update mounts, if there actually have been specified. -- Implement most of mount -ur functionality for tmpfs. Remaining issue is the question who is responsible for syncing pending writes, but the functionality is good enough for serving as read-only chroot base in bulk builds. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.63.2.1 src/sys/fs/tmpfs/tmpfs_vfsops.c cvs rdiff -u -r1.120.2.1 -r1.120.2.2 src/sys/fs/tmpfs/tmpfs_vnops.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/fs/tmpfs/tmpfs_vfsops.c diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.63 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.63.2.1 --- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.63 Tue Jun 10 16:10:59 2014 +++ src/sys/fs/tmpfs/tmpfs_vfsops.c Mon May 9 19:45:00 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs_vfsops.c,v 1.63 2014/06/10 16:10:59 martin Exp $ */ +/* $NetBSD: tmpfs_vfsops.c,v 1.63.2.1 2016/05/09 19:45:00 snj Exp $ */ /* * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.63 2014/06/10 16:10:59 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.63.2.1 2016/05/09 19:45:00 snj Exp $"); #include #include @@ -102,6 +102,8 @@ tmpfs_mount(struct mount *mp, const char uint64_t memlimit; ino_t nodes; int error; + bool set_memlimit; + bool set_nodes; if (args == NULL) return EINVAL; @@ -146,26 +148,33 @@ tmpfs_mount(struct mount *mp, const char /* Get the memory usage limit for this file-system. */ if (args->ta_size_max < PAGE_SIZE) { memlimit = UINT64_MAX; + set_memlimit = false; } else { memlimit = args->ta_size_max; + set_memlimit = true; } KASSERT(memlimit > 0); if (args->ta_nodes_max <= 3) { nodes = 3 + (memlimit / 1024); + set_nodes = false; } else { nodes = args->ta_nodes_max; + set_nodes = true; } nodes = MIN(nodes, INT_MAX); KASSERT(nodes >= 3); if (mp->mnt_flag & MNT_UPDATE) { tmp = VFS_TO_TMPFS(mp); - if (nodes < tmp->tm_nodes_cnt) + if (set_nodes && nodes < tmp->tm_nodes_cnt) return EBUSY; - if ((error = tmpfs_mntmem_set(tmp, memlimit)) != 0) - return error; - tmp->tm_nodes_max = nodes; + if (set_memlimit) { + if ((error = tmpfs_mntmem_set(tmp, memlimit)) != 0) +return error; + } + if (set_nodes) + tmp->tm_nodes_max = nodes; root = tmp->tm_root; root->tn_uid = args->ta_root_uid; root->tn_gid = args->ta_root_gid; @@ -205,7 +214,7 @@ tmpfs_mount(struct mount *mp, const char mp->mnt_stat.f_namemax = TMPFS_MAXNAMLEN; mp->mnt_fs_bshift = PAGE_SHIFT; mp->mnt_dev_bshift = DEV_BSHIFT; - mp->mnt_iflag |= IMNT_MPSAFE; + mp->mnt_iflag |= IMNT_MPSAFE | IMNT_CAN_RWTORO; vfs_getnewfsid(mp); error = set_statvfs_info(path, UIO_USERSPACE, "tmpfs", UIO_SYSSPACE, Index: src/sys/fs/tmpfs/tmpfs_vnops.c diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.120.2.1 src/sys/fs/tmpfs/tmpfs_vnops.c:1.120.2.2 --- src/sys/fs/tmpfs/tmpfs_vnops.c:1.120.2.1 Mon Dec 22 02:05:08 2014 +++ src/sys/fs/tmpfs/tmpfs_vnops.c Mon May 9 19:45:00 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs_vnops.c,v 1.120.2.1 2014/12/22 02:05:08 msaitoh Exp $ */ +/* $NetBSD: tmpfs_vnops.c,v 1.120.2.2 2016/05/09 19:45:00 snj Exp $ */ /* * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.120.2.1 2014/12/22 02:05:08 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.120.2.2 2016/05/09 19:45:00 snj Exp $"); #include #include @@ -589,6 +589,11 @@ tmpfs_write(void *v) KASSERT(VOP_ISLOCKED(vp)); + if ((vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { + error = EROFS; + goto out; + } + node = VP_TO_TMPFS_NODE(vp); oldsize = node->tn_size; @@ -1267,6 +1272,11 @@ tmpfs_putpages(void *v) return 0; } + if ((vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { + mutex_exit(vp->v_interlock); + return EROFS; + } + node = VP_TO_TMPFS_NODE(vp); uobj = node->tn_spec.tn_reg.tn_aobj;
CVS commit: [netbsd-7] src/sys/rump/librump/rumpkern
Module Name:src Committed By: snj Date: Mon May 9 19:40:44 UTC 2016 Modified Files: src/sys/rump/librump/rumpkern [netbsd-7]: rump.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1162): sys/rump/librump/rumpkern/rump.c: revision 1.329 Align the message buffer. The kernel routines normally are used only with page aligned buffers and they assume at least pointer alignment. Be defensive here and align to 256 Bytes. To generate a diff of this commit: cvs rdiff -u -r1.308.2.3 -r1.308.2.4 src/sys/rump/librump/rumpkern/rump.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/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.308.2.3 src/sys/rump/librump/rumpkern/rump.c:1.308.2.4 --- src/sys/rump/librump/rumpkern/rump.c:1.308.2.3 Wed Mar 25 16:54:37 2015 +++ src/sys/rump/librump/rumpkern/rump.c Mon May 9 19:40:44 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.308.2.3 2015/03/25 16:54:37 snj Exp $ */ +/* $NetBSD: rump.c,v 1.308.2.4 2016/05/09 19:40:44 snj Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.308.2.3 2015/03/25 16:54:37 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.308.2.4 2016/05/09 19:40:44 snj Exp $"); #include #define ELFSIZE ARCH_ELFSIZE @@ -109,7 +109,8 @@ static void rump_hyp_execnotify(const ch static void rump_component_addlocal(void); static struct lwp *bootlwp; -static char rump_msgbuf[16*1024]; /* 16k should be enough for std rump needs */ +/* 16k should be enough for std rump needs */ +static char rump_msgbuf[16*1024] __aligned(256); bool rump_ttycomponent = false;
CVS commit: [netbsd-7] src/sys/rump/librump/rumpkern
Module Name:src Committed By: snj Date: Mon May 9 19:40:44 UTC 2016 Modified Files: src/sys/rump/librump/rumpkern [netbsd-7]: rump.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1162): sys/rump/librump/rumpkern/rump.c: revision 1.329 Align the message buffer. The kernel routines normally are used only with page aligned buffers and they assume at least pointer alignment. Be defensive here and align to 256 Bytes. To generate a diff of this commit: cvs rdiff -u -r1.308.2.3 -r1.308.2.4 src/sys/rump/librump/rumpkern/rump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-7] src/lib/libc/stdlib
Module Name:src Committed By: snj Date: Mon May 9 19:34:50 UTC 2016 Modified Files: src/lib/libc/stdlib [netbsd-7]: jemalloc.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1161): lib/libc/stdlib/jemalloc.c: revision 1.40 lib/50791: Instead of using sorting the arena chunks by address only, sort by size of the longest run and address as tie break. Avoids long linear searches for code heavy on medium sized allocations. To generate a diff of this commit: cvs rdiff -u -r1.34.2.1 -r1.34.2.2 src/lib/libc/stdlib/jemalloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/jemalloc.c diff -u src/lib/libc/stdlib/jemalloc.c:1.34.2.1 src/lib/libc/stdlib/jemalloc.c:1.34.2.2 --- src/lib/libc/stdlib/jemalloc.c:1.34.2.1 Tue Nov 24 17:37:16 2015 +++ src/lib/libc/stdlib/jemalloc.c Mon May 9 19:34:50 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: jemalloc.c,v 1.34.2.1 2015/11/24 17:37:16 martin Exp $ */ +/* $NetBSD: jemalloc.c,v 1.34.2.2 2016/05/09 19:34:50 snj Exp $ */ /*- * Copyright (C) 2006,2007 Jason Evans. @@ -118,7 +118,7 @@ #include /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ -__RCSID("$NetBSD: jemalloc.c,v 1.34.2.1 2015/11/24 17:37:16 martin Exp $"); +__RCSID("$NetBSD: jemalloc.c,v 1.34.2.2 2016/05/09 19:34:50 snj Exp $"); #ifdef __FreeBSD__ #include "libc_private.h" @@ -1671,6 +1671,11 @@ arena_run_comp(arena_run_t *a, arena_run assert(a != NULL); assert(b != NULL); + if (a->max_frun_npages < b->max_frun_npages) + return -1; + if (a->max_frun_npages > b->max_frun_npages) + return 1; + if ((uintptr_t)a < (uintptr_t)b) return (-1); else if (a == b) @@ -1902,9 +1907,6 @@ arena_chunk_alloc(arena_t *arena) chunk->arena = arena; - /* LINTED */ - RB_INSERT(arena_chunk_tree_s, >chunks, chunk); - /* * Claim that no pages are in use, since the header is merely * overhead. @@ -1924,6 +1926,8 @@ arena_chunk_alloc(arena_t *arena) chunk->map[chunk_npages - 1].npages = chunk_npages - arena_chunk_header_npages; chunk->map[chunk_npages - 1].pos = POS_FREE; + + RB_INSERT(arena_chunk_tree_s, >chunks, chunk); } return (chunk); @@ -1960,30 +1964,44 @@ arena_chunk_dealloc(arena_t *arena, aren static arena_run_t * arena_run_alloc(arena_t *arena, size_t size) { - arena_chunk_t *chunk; + arena_chunk_t *chunk, *chunk_tmp; arena_run_t *run; - unsigned need_npages, limit_pages, compl_need_npages; + unsigned need_npages; assert(size <= (chunksize - (arena_chunk_header_npages << pagesize_2pow))); assert((size & pagesize_mask) == 0); /* - * Search through arena's chunks in address order for a free run that is - * large enough. Look for the first fit. + * Search through the arena chunk tree for a large enough free run. + * Tree order ensures that any exact fit is picked immediately or + * otherwise the lowest address of the next size. */ need_npages = (unsigned)(size >> pagesize_2pow); - limit_pages = chunk_npages - arena_chunk_header_npages; - compl_need_npages = limit_pages - need_npages; /* LINTED */ - RB_FOREACH(chunk, arena_chunk_tree_s, >chunks) { + for (;;) { + chunk_tmp = RB_ROOT(>chunks); + chunk = NULL; + while (chunk_tmp) { + if (chunk_tmp->max_frun_npages == need_npages) { +chunk = chunk_tmp; +break; + } + if (chunk_tmp->max_frun_npages < need_npages) { +chunk_tmp = RB_RIGHT(chunk_tmp, link); +continue; + } + chunk = chunk_tmp; + chunk_tmp = RB_LEFT(chunk, link); + } + if (chunk == NULL) + break; /* - * Avoid searching this chunk if there are not enough - * contiguous free pages for there to possibly be a large - * enough free run. + * At this point, the chunk must have a cached run size large + * enough to fit the allocation. */ - if (chunk->pages_used <= compl_need_npages && - need_npages <= chunk->max_frun_npages) { + assert(need_npages <= chunk->max_frun_npages); + { arena_chunk_map_t *mapelm; unsigned i; unsigned max_frun_npages = 0; @@ -2021,7 +2039,9 @@ arena_run_alloc(arena_t *arena, size_t s * chunk->min_frun_ind was already reset above (if * necessary). */ + RB_REMOVE(arena_chunk_tree_s, >chunks, chunk); chunk->max_frun_npages = max_frun_npages; + RB_INSERT(arena_chunk_tree_s, >chunks, chunk); } } @@ -2104,8 +2124,11 @@ arena_run_dalloc(arena_t *arena, arena_r assert(chunk->map[run_ind + run_pages - 1].pos == POS_FREE); } - if (chunk->map[run_ind].npages > chunk->max_frun_npages) + if (chunk->map[run_ind].npages > chunk->max_frun_npages) { + RB_REMOVE(arena_chunk_tree_s, >chunks, chunk); chunk->max_frun_npages = chunk->map[run_ind].npages; + RB_INSERT(arena_chunk_tree_s, >chunks, chunk); + } if (run_ind < chunk->min_frun_ind) chunk->min_frun_ind = run_ind;
CVS commit: [netbsd-7] src/lib/libc/stdlib
Module Name:src Committed By: snj Date: Mon May 9 19:34:50 UTC 2016 Modified Files: src/lib/libc/stdlib [netbsd-7]: jemalloc.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1161): lib/libc/stdlib/jemalloc.c: revision 1.40 lib/50791: Instead of using sorting the arena chunks by address only, sort by size of the longest run and address as tie break. Avoids long linear searches for code heavy on medium sized allocations. To generate a diff of this commit: cvs rdiff -u -r1.34.2.1 -r1.34.2.2 src/lib/libc/stdlib/jemalloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/hppa/conf
Module Name:src Committed By: skrll Date: Mon May 9 15:23:23 UTC 2016 Modified Files: src/sys/arch/hppa/conf: majors.hppa Log Message: Use the MI usb majors To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/conf/majors.hppa 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/hppa/conf/majors.hppa diff -u src/sys/arch/hppa/conf/majors.hppa:1.2 src/sys/arch/hppa/conf/majors.hppa:1.3 --- src/sys/arch/hppa/conf/majors.hppa:1.2 Thu Apr 23 23:22:51 2015 +++ src/sys/arch/hppa/conf/majors.hppa Mon May 9 15:23:23 2016 @@ -1,4 +1,4 @@ -# $NetBSD: majors.hppa,v 1.2 2015/04/23 23:22:51 pgoyette Exp $ +# $NetBSD: majors.hppa,v 1.3 2016/05/09 15:23:23 skrll Exp $ # # Device majors for hppa # @@ -52,3 +52,5 @@ device-major nsmb char 98 nsmb # Majors up to 143 are reserved for machine-dependent drivers. # New machine-independent driver majors are assigned in # sys/conf/majors. + +include "conf/majors.usb"
CVS commit: src/sys/arch/hppa/conf
Module Name:src Committed By: skrll Date: Mon May 9 15:23:23 UTC 2016 Modified Files: src/sys/arch/hppa/conf: majors.hppa Log Message: Use the MI usb majors To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/conf/majors.hppa Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: christos Date: Mon May 9 15:11:35 UTC 2016 Modified Files: src/sys/arch/xen/xen: xennetback_xenbus.c Log Message: Account for the CRC len (Jean-Jacques.Puig) To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.55 src/sys/arch/xen/xen/xennetback_xenbus.c:1.56 --- src/sys/arch/xen/xen/xennetback_xenbus.c:1.55 Tue Feb 9 03:32:10 2016 +++ src/sys/arch/xen/xen/xennetback_xenbus.c Mon May 9 11:11:35 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: xennetback_xenbus.c,v 1.55 2016/02/09 08:32:10 ozaki-r Exp $ */ +/* $NetBSD: xennetback_xenbus.c,v 1.56 2016/05/09 15:11:35 christos Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.55 2016/02/09 08:32:10 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.56 2016/05/09 15:11:35 christos Exp $"); #include "opt_xen.h" @@ -720,8 +720,9 @@ xennetback_tx_check_packet(const netif_t if (__predict_false(txreq->offset + txreq->size > PAGE_SIZE)) return "crossing a page boundary"; - const int maxlen = - vlan ? (ETHER_VLAN_ENCAP_LEN + ETHER_MAX_LEN) : ETHER_MAX_LEN; + int maxlen = ETHER_MAX_LEN - ETHER_CRC_LEN; + if (vlan) + maxlen += ETHER_VLAN_ENCAP_LEN; if (__predict_false(txreq->size > maxlen)) return "too big";
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: christos Date: Mon May 9 15:11:35 UTC 2016 Modified Files: src/sys/arch/xen/xen: xennetback_xenbus.c Log Message: Account for the CRC len (Jean-Jacques.Puig) To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/xen/xennetback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Mon May 9 15:05:15 UTC 2016 Modified Files: src/sys/net: if_vlan.c Log Message: Don't increment the reference count only when it was 0... >From Jean-Jacques.Puig To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/net/if_vlan.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_vlan.c diff -u src/sys/net/if_vlan.c:1.87 src/sys/net/if_vlan.c:1.88 --- src/sys/net/if_vlan.c:1.87 Wed Apr 27 21:37:17 2016 +++ src/sys/net/if_vlan.c Mon May 9 11:05:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vlan.c,v 1.87 2016/04/28 01:37:17 knakahara Exp $ */ +/* $NetBSD: if_vlan.c,v 1.88 2016/05/09 15:05:15 christos Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.87 2016/04/28 01:37:17 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.88 2016/05/09 15:05:15 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -300,8 +300,8 @@ vlan_config(struct ifvlan *ifv, struct i */ ifv->ifv_mtufudge = ifv->ifv_encaplen; } - ec->ec_nvlans++; } + ec->ec_nvlans++; /* * If the parent interface can do hardware-assisted
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Mon May 9 15:05:15 UTC 2016 Modified Files: src/sys/net: if_vlan.c Log Message: Don't increment the reference count only when it was 0... >From Jean-Jacques.Puig To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/net/if_vlan.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/doc
Module Name:src Committed By: roy Date: Mon May 9 10:21:42 UTC 2016 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: Note import of dhcpcd-6.11.0 To generate a diff of this commit: cvs rdiff -u -r1.1328 -r1.1329 src/doc/3RDPARTY cvs rdiff -u -r1.2158 -r1.2159 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1328 src/doc/3RDPARTY:1.1329 --- src/doc/3RDPARTY:1.1328 Sun May 8 09:19:28 2016 +++ src/doc/3RDPARTY Mon May 9 10:21:42 2016 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1328 2016/05/08 09:19:28 wiz Exp $ +# $NetBSD: 3RDPARTY,v 1.1329 2016/05/09 10:21:42 roy Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -306,8 +306,8 @@ Notes: Use the dhcp2netbsd script. Package: dhcpcd -Version: 6.10.3 -Current Vers: 6.10.3 +Version: 6.11.0 +Current Vers: 6.11.0 Maintainer: roy Archive Site: ftp://roy.marples.name/pub/dhcpcd/ Home Page: http://roy.marples.name/projects/dhcpcd/ Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2158 src/doc/CHANGES:1.2159 --- src/doc/CHANGES:1.2158 Wed May 4 19:28:32 2016 +++ src/doc/CHANGES Mon May 9 10:21:42 2016 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2158 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2159 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -287,3 +287,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0: ntp: Import ntp 4.2.8p7. [christos 20160501] openssl: Import openssl 1.0.1t - security fixes [christos 20160503] acpi(4): Updated ACPICA to 20160422. [christos 20160504] + dhcpcd(8): Import dhcpcd-6.11.0 [roy 20160509]
CVS commit: src/doc
Module Name:src Committed By: roy Date: Mon May 9 10:21:42 UTC 2016 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: Note import of dhcpcd-6.11.0 To generate a diff of this commit: cvs rdiff -u -r1.1328 -r1.1329 src/doc/3RDPARTY cvs rdiff -u -r1.2158 -r1.2159 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd
Module Name:src Committed By: roy Date: Mon May 9 10:19:26 UTC 2016 Modified Files: src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile Log Message: Define _OPENBSD_SOURCE so dhcpcd can access reallocarray(3). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.30 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.31 --- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.30 Sun Apr 10 21:06:54 2016 +++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile Mon May 9 10:19:26 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.30 2016/04/10 21:06:54 roy Exp $ +# $NetBSD: Makefile,v 1.31 2016/05/09 10:19:26 roy Exp $ # PROG= dhcpcd @@ -10,7 +10,7 @@ SRCS+= if-bsd.c WARNS?= 6 USE_FORT?= yes # network client (local server) -CPPFLAGS+= -DHAVE_CONFIG_H +CPPFLAGS+= -DHAVE_CONFIG_H -D_OPENBSD_SOURCE .include
CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd
Module Name:src Committed By: roy Date: Mon May 9 10:19:26 UTC 2016 Modified Files: src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile Log Message: Define _OPENBSD_SOURCE so dhcpcd can access reallocarray(3). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Mon May 9 10:15:59 UTC 2016 Modified Files: src/external/bsd/dhcpcd/dist: arp.c arp.h auth.c common.c common.h config.h control.c control.h defs.h dhcp-common.c dhcp-common.h dhcp.c dhcp.h dhcp6.c dhcpcd.8.in dhcpcd.c dhcpcd.conf.5.in dhcpcd.h duid.c eloop.c if-bsd.c if-options.c if-options.h if.c if.h ipv4.c ipv4.h ipv4ll.c ipv6.c ipv6.h script.c src/external/bsd/dhcpcd/dist/crypt: hmac_md5.c Log Message: Sync To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/bsd/dhcpcd/dist/arp.c \ src/external/bsd/dhcpcd/dist/if-options.h cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/arp.h \ src/external/bsd/dhcpcd/dist/control.c \ src/external/bsd/dhcpcd/dist/dhcp-common.h cvs rdiff -u -r1.10 -r1.11 src/external/bsd/dhcpcd/dist/auth.c \ src/external/bsd/dhcpcd/dist/config.h cvs rdiff -u -r1.19 -r1.20 src/external/bsd/dhcpcd/dist/common.c cvs rdiff -u -r1.13 -r1.14 src/external/bsd/dhcpcd/dist/common.h \ src/external/bsd/dhcpcd/dist/eloop.c cvs rdiff -u -r1.7 -r1.8 src/external/bsd/dhcpcd/dist/control.h cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/defs.h \ src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in cvs rdiff -u -r1.15 -r1.16 src/external/bsd/dhcpcd/dist/dhcp-common.c \ src/external/bsd/dhcpcd/dist/if.h src/external/bsd/dhcpcd/dist/ipv4ll.c cvs rdiff -u -r1.39 -r1.40 src/external/bsd/dhcpcd/dist/dhcp.c cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/dhcp.h cvs rdiff -u -r1.20 -r1.21 src/external/bsd/dhcpcd/dist/dhcp6.c \ src/external/bsd/dhcpcd/dist/if.c cvs rdiff -u -r1.47 -r1.48 src/external/bsd/dhcpcd/dist/dhcpcd.8.in cvs rdiff -u -r1.33 -r1.34 src/external/bsd/dhcpcd/dist/dhcpcd.c cvs rdiff -u -r1.16 -r1.17 src/external/bsd/dhcpcd/dist/dhcpcd.h \ src/external/bsd/dhcpcd/dist/ipv4.h cvs rdiff -u -r1.11 -r1.12 src/external/bsd/dhcpcd/dist/duid.c cvs rdiff -u -r1.29 -r1.30 src/external/bsd/dhcpcd/dist/if-bsd.c cvs rdiff -u -r1.32 -r1.33 src/external/bsd/dhcpcd/dist/if-options.c cvs rdiff -u -r1.21 -r1.22 src/external/bsd/dhcpcd/dist/ipv4.c cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/ipv6.c \ src/external/bsd/dhcpcd/dist/ipv6.h cvs rdiff -u -r1.25 -r1.26 src/external/bsd/dhcpcd/dist/script.c cvs rdiff -u -r1.7 -r1.8 src/external/bsd/dhcpcd/dist/crypt/hmac_md5.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS import: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Mon May 9 10:10:47 UTC 2016 Update of /cvsroot/src/external/bsd/dhcpcd/dist In directory ivanova.netbsd.org:/tmp/cvs-serv21395 Log Message: Import dhcpcd-6.11.0 with the following changes: * pidfile directory is now created correctly at startup. * bootp "leases" are now stored so dhcpcd can dump them. * ARP state is keep open so we can detect duplicates (currently this is only logged, no action is taken). * --lastleastextend allows dhcpcd to extend a DHCP lease once it has expired. The lease is dropped if any other node claims the address. * Delegated Prefix reject routes will be correctly bound to the loopback interface. If a delegated address uses the whole prefix, then the reject route is removed. If this address is removed, the reject route is restored. * dhcp code has been reworked around a classic BOOTP structure instead of a fixed size DHCP structure based on a max MTU of 1500. Each reference to it also has a size so we know it's length. Adding an option to a message is now guarded via easy macros. Option concatenation buffer is no longer a fixed size. * many more changes so that dhcpcd passes all current Coverity tests. Status: Vendor Tag: roy Release Tags: dhcpcd-6-11-0 C src/external/bsd/dhcpcd/dist/common.c C src/external/bsd/dhcpcd/dist/control.c C src/external/bsd/dhcpcd/dist/dhcpcd.c C src/external/bsd/dhcpcd/dist/duid.c C src/external/bsd/dhcpcd/dist/eloop.c C src/external/bsd/dhcpcd/dist/if.c C src/external/bsd/dhcpcd/dist/if-options.c C src/external/bsd/dhcpcd/dist/script.c C src/external/bsd/dhcpcd/dist/dhcp-common.c C src/external/bsd/dhcpcd/dist/if-bsd.c C src/external/bsd/dhcpcd/dist/arp.c C src/external/bsd/dhcpcd/dist/dhcp.c C src/external/bsd/dhcpcd/dist/ipv4.c C src/external/bsd/dhcpcd/dist/ipv4ll.c C src/external/bsd/dhcpcd/dist/ipv6.c U src/external/bsd/dhcpcd/dist/ipv6nd.c C src/external/bsd/dhcpcd/dist/dhcp6.c U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c C src/external/bsd/dhcpcd/dist/auth.c U src/external/bsd/dhcpcd/dist/dhcpcd.conf U src/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in C src/external/bsd/dhcpcd/dist/dhcpcd.8.in C src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in C src/external/bsd/dhcpcd/dist/arp.h U src/external/bsd/dhcpcd/dist/auth.h U src/external/bsd/dhcpcd/dist/bpf-filter.h C src/external/bsd/dhcpcd/dist/common.h C src/external/bsd/dhcpcd/dist/config.h C src/external/bsd/dhcpcd/dist/control.h C src/external/bsd/dhcpcd/dist/defs.h U src/external/bsd/dhcpcd/dist/dev.h C src/external/bsd/dhcpcd/dist/dhcp-common.h C src/external/bsd/dhcpcd/dist/dhcp.h U src/external/bsd/dhcpcd/dist/dhcp6.h U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h C src/external/bsd/dhcpcd/dist/dhcpcd.h U src/external/bsd/dhcpcd/dist/duid.h U src/external/bsd/dhcpcd/dist/eloop.h C src/external/bsd/dhcpcd/dist/if-options.h C src/external/bsd/dhcpcd/dist/if.h C src/external/bsd/dhcpcd/dist/ipv4.h U src/external/bsd/dhcpcd/dist/ipv4ll.h C src/external/bsd/dhcpcd/dist/ipv6.h U src/external/bsd/dhcpcd/dist/ipv6nd.h U src/external/bsd/dhcpcd/dist/script.h C src/external/bsd/dhcpcd/dist/crypt/hmac_md5.c U src/external/bsd/dhcpcd/dist/crypt/crypt.h U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind 32 conflicts created by this import. Use the following command to help the merge: cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist
CVS import: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Mon May 9 10:10:47 UTC 2016 Update of /cvsroot/src/external/bsd/dhcpcd/dist In directory ivanova.netbsd.org:/tmp/cvs-serv21395 Log Message: Import dhcpcd-6.11.0 with the following changes: * pidfile directory is now created correctly at startup. * bootp "leases" are now stored so dhcpcd can dump them. * ARP state is keep open so we can detect duplicates (currently this is only logged, no action is taken). * --lastleastextend allows dhcpcd to extend a DHCP lease once it has expired. The lease is dropped if any other node claims the address. * Delegated Prefix reject routes will be correctly bound to the loopback interface. If a delegated address uses the whole prefix, then the reject route is removed. If this address is removed, the reject route is restored. * dhcp code has been reworked around a classic BOOTP structure instead of a fixed size DHCP structure based on a max MTU of 1500. Each reference to it also has a size so we know it's length. Adding an option to a message is now guarded via easy macros. Option concatenation buffer is no longer a fixed size. * many more changes so that dhcpcd passes all current Coverity tests. Status: Vendor Tag: roy Release Tags: dhcpcd-6-11-0 C src/external/bsd/dhcpcd/dist/common.c C src/external/bsd/dhcpcd/dist/control.c C src/external/bsd/dhcpcd/dist/dhcpcd.c C src/external/bsd/dhcpcd/dist/duid.c C src/external/bsd/dhcpcd/dist/eloop.c C src/external/bsd/dhcpcd/dist/if.c C src/external/bsd/dhcpcd/dist/if-options.c C src/external/bsd/dhcpcd/dist/script.c C src/external/bsd/dhcpcd/dist/dhcp-common.c C src/external/bsd/dhcpcd/dist/if-bsd.c C src/external/bsd/dhcpcd/dist/arp.c C src/external/bsd/dhcpcd/dist/dhcp.c C src/external/bsd/dhcpcd/dist/ipv4.c C src/external/bsd/dhcpcd/dist/ipv4ll.c C src/external/bsd/dhcpcd/dist/ipv6.c U src/external/bsd/dhcpcd/dist/ipv6nd.c C src/external/bsd/dhcpcd/dist/dhcp6.c U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c C src/external/bsd/dhcpcd/dist/auth.c U src/external/bsd/dhcpcd/dist/dhcpcd.conf U src/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in C src/external/bsd/dhcpcd/dist/dhcpcd.8.in C src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in C src/external/bsd/dhcpcd/dist/arp.h U src/external/bsd/dhcpcd/dist/auth.h U src/external/bsd/dhcpcd/dist/bpf-filter.h C src/external/bsd/dhcpcd/dist/common.h C src/external/bsd/dhcpcd/dist/config.h C src/external/bsd/dhcpcd/dist/control.h C src/external/bsd/dhcpcd/dist/defs.h U src/external/bsd/dhcpcd/dist/dev.h C src/external/bsd/dhcpcd/dist/dhcp-common.h C src/external/bsd/dhcpcd/dist/dhcp.h U src/external/bsd/dhcpcd/dist/dhcp6.h U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h C src/external/bsd/dhcpcd/dist/dhcpcd.h U src/external/bsd/dhcpcd/dist/duid.h U src/external/bsd/dhcpcd/dist/eloop.h C src/external/bsd/dhcpcd/dist/if-options.h C src/external/bsd/dhcpcd/dist/if.h C src/external/bsd/dhcpcd/dist/ipv4.h U src/external/bsd/dhcpcd/dist/ipv4ll.h C src/external/bsd/dhcpcd/dist/ipv6.h U src/external/bsd/dhcpcd/dist/ipv6nd.h U src/external/bsd/dhcpcd/dist/script.h C src/external/bsd/dhcpcd/dist/crypt/hmac_md5.c U src/external/bsd/dhcpcd/dist/crypt/crypt.h U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind 32 conflicts created by this import. Use the following command to help the merge: cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist
CVS commit: src/sys/netinet
Module Name:src Committed By: ozaki-r Date: Mon May 9 07:02:10 UTC 2016 Modified Files: src/sys/netinet: ip_output.c Log Message: Fix compilation for ppc To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/sys/netinet/ip_output.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/netinet/ip_output.c diff -u src/sys/netinet/ip_output.c:1.254 src/sys/netinet/ip_output.c:1.255 --- src/sys/netinet/ip_output.c:1.254 Wed May 4 15:42:32 2016 +++ src/sys/netinet/ip_output.c Mon May 9 07:02:10 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_output.c,v 1.254 2016/05/04 15:42:32 christos Exp $ */ +/* $NetBSD: ip_output.c,v 1.255 2016/05/09 07:02:10 ozaki-r Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.254 2016/05/04 15:42:32 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.255 2016/05/09 07:02:10 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1500,7 +1500,7 @@ ip_get_membership(const struct sockopt * static int ip_add_membership(struct ip_moptions *imo, const struct sockopt *sopt) { - struct ifnet *ifp; + struct ifnet *ifp = NULL; // XXX: gcc [ppc] struct in_addr ia; int i, error;
CVS commit: src/sys/netinet
Module Name:src Committed By: ozaki-r Date: Mon May 9 07:02:10 UTC 2016 Modified Files: src/sys/netinet: ip_output.c Log Message: Fix compilation for ppc To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/sys/netinet/ip_output.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.