CVS commit: src/tests/usr.bin/sed
Module Name:src Committed By: gutteridge Date: Sat May 6 02:12:11 UTC 2023 Modified Files: src/tests/usr.bin/sed: t_sed.sh Log Message: t_sed.sh: add a test case for relative addressing At one time, this didn't always work correctly, per PR bin/49109. Test case from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192108 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/sed/t_sed.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/usr.bin/sed/t_sed.sh diff -u src/tests/usr.bin/sed/t_sed.sh:1.10 src/tests/usr.bin/sed/t_sed.sh:1.11 --- src/tests/usr.bin/sed/t_sed.sh:1.10 Sat May 6 02:07:42 2023 +++ src/tests/usr.bin/sed/t_sed.sh Sat May 6 02:12:11 2023 @@ -1,4 +1,4 @@ -# $NetBSD: t_sed.sh,v 1.10 2023/05/06 02:07:42 gutteridge Exp $ +# $NetBSD: t_sed.sh,v 1.11 2023/05/06 02:12:11 gutteridge Exp $ # # Copyright (c) 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -175,6 +175,16 @@ escapes_in_re_bracket_body() { -x 'echo "foo\\d88bar" | sed -e "s/[\d88]/ /g"' } +atf_test_case relative_addressing +relative_addressing_head() { + atf_set "descr" "Test that sed(1) handles relative addressing " \ + "properly (PR bin/49109)" +} + +relative_addressing_body() { + atf_check -o match:"3" -x 'seq 1 4 | sed -n "1,+2p" | wc -l' +} + atf_init_test_cases() { atf_add_test_case c2048 atf_add_test_case emptybackref @@ -184,4 +194,5 @@ atf_init_test_cases() { atf_add_test_case escapes_in_subst atf_add_test_case escapes_in_re atf_add_test_case escapes_in_re_bracket + atf_add_test_case relative_addressing }
CVS commit: src/tests/usr.bin/sed
Module Name:src Committed By: gutteridge Date: Sat May 6 02:12:11 UTC 2023 Modified Files: src/tests/usr.bin/sed: t_sed.sh Log Message: t_sed.sh: add a test case for relative addressing At one time, this didn't always work correctly, per PR bin/49109. Test case from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192108 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/sed/t_sed.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/sed
Module Name:src Committed By: gutteridge Date: Sat May 6 02:07:42 UTC 2023 Modified Files: src/tests/usr.bin/sed: t_sed.sh Log Message: t_sed.sh: fix grammar, spelling, and formatting issues (NFC) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/sed/t_sed.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/usr.bin/sed/t_sed.sh diff -u src/tests/usr.bin/sed/t_sed.sh:1.9 src/tests/usr.bin/sed/t_sed.sh:1.10 --- src/tests/usr.bin/sed/t_sed.sh:1.9 Sun Nov 7 20:31:09 2021 +++ src/tests/usr.bin/sed/t_sed.sh Sat May 6 02:07:42 2023 @@ -1,4 +1,4 @@ -# $NetBSD: t_sed.sh,v 1.9 2021/11/07 20:31:09 andvar Exp $ +# $NetBSD: t_sed.sh,v 1.10 2023/05/06 02:07:42 gutteridge Exp $ # # Copyright (c) 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -31,7 +31,7 @@ atf_test_case c2048 c2048_head() { atf_set "descr" "Test that sed(1) does not fail when the " \ - "2048'th character is a backslash (PR bin/25899)" + "2048th character is a backslash (PR bin/25899)" } c2048_body() { @@ -81,7 +81,7 @@ rangeselection_body() { -x "printf 'A\nB\nC\nD\n' | sed '1,3d'" atf_check -o inline:"A\n" \ -x "printf 'A\nB\nC\nD\n' | sed '2,4d'" - # two nonoverlapping ranges + # two non-overlapping ranges atf_check -o inline:"C\n" \ -x "printf 'A\nB\nC\nD\nE\n' | sed '1,2d;4,5d'" # overlapping ranges; the first prevents the second from being entered @@ -98,7 +98,7 @@ rangeselection_body() { -x "printf 'A\nB\nC\nD\n' | sed '/A/,/C/d'" atf_check -o inline:"A\n" \ -x "printf 'A\nB\nC\nD\n' | sed '/B/,/D/d'" - # two nonoverlapping ranges + # two non-overlapping ranges atf_check -o inline:"C\n" \ -x "printf 'A\nB\nC\nD\nE\n' | sed '/A/,/B/d;/D/,/E/d'" # two overlapping ranges; the first blocks the second as above @@ -174,6 +174,7 @@ escapes_in_re_bracket_body() { atf_check -o inline:"foobar\n" \ -x 'echo "foo\\d88bar" | sed -e "s/[\d88]/ /g"' } + atf_init_test_cases() { atf_add_test_case c2048 atf_add_test_case emptybackref
CVS commit: src/tests/usr.bin/sed
Module Name:src Committed By: gutteridge Date: Sat May 6 02:07:42 UTC 2023 Modified Files: src/tests/usr.bin/sed: t_sed.sh Log Message: t_sed.sh: fix grammar, spelling, and formatting issues (NFC) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/sed/t_sed.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/ftp
nnect */ + if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) { + warn("Can't set socket non-blocking for SSL connect to `%s'", + servername); + goto cleanup_start_ssl; + } + + /* NOTE: we now must restore socket flags on successful connection */ + + (void)gettimeofday(, NULL); /* setup SSL_connect() timeout */ + timeout.tv_sec += (quit_time > 0) ? quit_time: 60; + /* without -q, default to 60s */ + SSL_set_fd(ssl, sock); if (!SSL_set_tlsext_host_name(ssl, __UNCONST(servername))) { - fprintf(ttyout, "SSL hostname setting failed\n"); - SSL_free(ssl); - SSL_CTX_free(ctx); - return NULL; + warnx("SSL hostname setting failed"); + goto cleanup_start_ssl; } - while ((ret = SSL_connect(ssl)) == -1) { + pfd[0].fd = sock; + pfd[0].events = 0; + while ((ret = SSL_connect(ssl)) <= 0) { ssl_err = SSL_get_error(ssl, ret); - if (ssl_err != SSL_ERROR_WANT_READ && - ssl_err != SSL_ERROR_WANT_WRITE) { + DPRINTF("%s: SSL_connect() ret=%d ssl_err=%d\n", + __func__, ret, ssl_err); + if (ret == 0) { /* unsuccessful handshake */ ERR_print_errors_fp(ttyout); - SSL_free(ssl); - SSL_CTX_free(ctx); - return NULL; + goto cleanup_start_ssl; + } + if (ssl_err == SSL_ERROR_WANT_READ) { + pfd[0].events = POLLIN; + } else if (ssl_err == SSL_ERROR_WANT_WRITE) { + pfd[0].events = POLLOUT; + } else { + ERR_print_errors_fp(ttyout); + goto cleanup_start_ssl; + } + (void)gettimeofday(, NULL); + timersub(, , ); + timeout_secs = delta.tv_sec * 1000 + delta.tv_usec/1000; + if (timeout_secs < 0) + timeout_secs = 0; + rv = ftp_poll(pfd, 1, timeout_secs); + if (rv == 0) { /* poll for SSL_connect() timed out */ + fprintf(ttyout, "Timeout establishing SSL connection to `%s'\n", + servername); + goto cleanup_start_ssl; + } else if (rv == -1 && errno != EINTR && errno != EAGAIN) { + warn("Error polling for SSL connect to `%s'", servername); + goto cleanup_start_ssl; } } + if (fcntl(sock, F_SETFL, flags) == -1) { + /* restore socket flags */ + warn("Can't %s socket flags for SSL connect to `%s'", + "restore", servername); + goto cleanup_start_ssl; + } + if (ftp_debug && verbose) { X509 *cert; X509_NAME *name; @@ -666,6 +724,13 @@ fetch_start_ssl(int sock, const char *se } return ssl; + + cleanup_start_ssl: + if (ssl) + SSL_free(ssl); + if (ctx) + SSL_CTX_free(ctx); + return NULL; } #endif /* WITH_SSL */ Index: src/usr.bin/ftp/util.c diff -u src/usr.bin/ftp/util.c:1.166 src/usr.bin/ftp/util.c:1.167 --- src/usr.bin/ftp/util.c:1.166 Sat Feb 25 12:07:25 2023 +++ src/usr.bin/ftp/util.c Fri May 5 15:46:06 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.166 2023/02/25 12:07:25 mlelstv Exp $ */ +/* $NetBSD: util.c,v 1.167 2023/05/05 15:46:06 lukem Exp $ */ /*- * Copyright (c) 1997-2023 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ #include #ifndef lint -__RCSID("$NetBSD: util.c,v 1.166 2023/02/25 12:07:25 mlelstv Exp $"); +__RCSID("$NetBSD: util.c,v 1.167 2023/05/05 15:46:06 lukem Exp $"); #endif /* not lint */ /* @@ -1439,8 +1439,8 @@ ftp_connect(int sock, const struct socka } pfd[0].revents = 0; rv = ftp_poll(pfd, 1, timeout); - /* loop until poll ! EINTR */ - } while (rv == -1 && errno == EINTR); + /* loop until poll !EINTR && !EAGAIN */ + } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); if (rv == 0) { /* poll (connect) timed out */ errno = ETIMEDOUT; Index: src/usr.bin/ftp/version.h diff -u src/usr.bin/ftp/version.h:1.96 src/usr.bin/ftp/version.h:1.97 --- src/usr.bin/ftp/version.h:1.96 Sat Feb 25 12:07:25 2023 +++ src/usr.bin/ftp/version.h Fri May 5 15:46:06 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.96 2023/02/25 12:07:25 mlelstv Exp $ */ +/* $NetBSD: version.h,v 1.97 2023/05/05 15:46:06 lukem Exp $ */ /*- * Copyright (c) 1999-2023 The NetBSD Foundation, Inc. @@ -34,5 +34,5 @@ #endif #ifndef FTP_VERSION -#define FTP_VERSION "20230225" +#define FTP_VERSION "20230505" #endif
CVS commit: src/usr.bin/ftp
Module Name:src Committed By: lukem Date: Fri May 5 15:46:06 UTC 2023 Modified Files: src/usr.bin/ftp: ftp.c ssl.c util.c version.h Log Message: add timeout for ssl connect Implement a timeout for SSL connection setup, using -q QUITTIME, defaulting to 60 seconds. SSL_connect(3) (unlike connect(2)) doesn't timeout by default. Adapt ssl error messages destination: if unexpected error from local API, use warn()/warnx() to stderr; if expected error from a network operation (e.g., timeouts), use fprintf to ttyout (which might be stdout). Consistently use ftp_poll() instead of select(); ssl.c (using select()) was added 7 years after the previous uses of select() were converted to poll(). Check EAGAIN as well as existing EINTR error from ftp_poll(), for portability. To generate a diff of this commit: cvs rdiff -u -r1.174 -r1.175 src/usr.bin/ftp/ftp.c cvs rdiff -u -r1.14 -r1.15 src/usr.bin/ftp/ssl.c cvs rdiff -u -r1.166 -r1.167 src/usr.bin/ftp/util.c cvs rdiff -u -r1.96 -r1.97 src/usr.bin/ftp/version.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/nxp
Module Name:src Committed By: bouyer Date: Fri May 5 09:34:10 UTC 2023 Modified Files: src/sys/arch/arm/nxp: imx6sx_clk.c Log Message: remove commented out entries, leftover from the imx6q ccm code. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6sx_clk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/nxp/imx6sx_clk.c diff -u src/sys/arch/arm/nxp/imx6sx_clk.c:1.2 src/sys/arch/arm/nxp/imx6sx_clk.c:1.3 --- src/sys/arch/arm/nxp/imx6sx_clk.c:1.2 Fri May 5 09:29:35 2023 +++ src/sys/arch/arm/nxp/imx6sx_clk.c Fri May 5 09:34:09 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $ */ +/* $NetBSD: imx6sx_clk.c,v 1.3 2023/05/05 09:34:09 bouyer Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.3 2023/05/05 09:34:09 bouyer Exp $"); #include "opt_fdt.h" @@ -975,15 +975,13 @@ static const int audiovideo_div_tbl[] = static struct imx6_clk imx6sx_clks[] = { CLK_FIXED("dummy", 0), - CLK_FIXED("ckil", IMX6_CKIL_FREQ), CLK_FIXED("osc", IMX6_OSC_FREQ), CLK_FIXED("ipp_di0", IMX6_OSC_FREQ), CLK_FIXED("ipp_di1", IMX6_OSC_FREQ), CLK_FIXED("anaclk1", IMX6_ANACLK1_FREQ), CLK_FIXED("anaclk2", IMX6_ANACLK2_FREQ), -//# -//# CLK_FIXED_FACTOR("sata_ref", "pll6_enet", 5, 1), + CLK_FIXED_FACTOR("pcie_ref", "pll6_enet", 5, 1), CLK_FIXED_FACTOR("pll2_198m", "pll2_pfd2_396m", 2, 1), CLK_FIXED_FACTOR("pll3_120m", "pll3_usb_otg", 4, 1), @@ -991,15 +989,12 @@ static struct imx6_clk imx6sx_clks[] = { CLK_FIXED_FACTOR("pll3_60m", "pll3_usb_otg", 8, 1), CLK_FIXED_FACTOR("twd", "arm", 2, 1), CLK_FIXED_FACTOR("gpt_3m", "osc", 8, 1), -//# CLK_FIXED_FACTOR("video_27m", "pll3_pfd1_540m", 20, 1), -//# CLK_FIXED_FACTOR("gpu2d_axi", "mmdc_ch0_axi_podf", 1, 1), -//# CLK_FIXED_FACTOR("gpu3d_axi", "mmdc_ch0_axi_podf", 1, 1), CLK_FIXED_FACTOR("ldb_di0_div_3_5", "ldb_di0_sel", 7, 2), CLK_FIXED_FACTOR("ldb_di0_div_7", "ldb_di0_sel", 7, 1), CLK_FIXED_FACTOR("ldb_di1_div_3_5", "ldb_di1_sel", 7, 2), CLK_FIXED_FACTOR("ldb_di1_div_7", "ldb_di1_sel", 7, 1), CLK_FIXED_FACTOR("enet_ptp_ref", "pll6_enet", 20, 1), -//# + CLK_PFD("pll2_pfd0_352m", "pll2_bus", PFD_528, 0), CLK_PFD("pll2_pfd1_594m", "pll2_bus", PFD_528, 1), CLK_PFD("pll2_pfd2_396m", "pll2_bus", PFD_528, 2), @@ -1008,7 +1003,7 @@ static struct imx6_clk imx6sx_clks[] = { CLK_PFD("pll3_pfd1_540m", "pll3_usb_otg", PFD_480, 1), CLK_PFD("pll3_pfd2_508m", "pll3_usb_otg", PFD_480, 2), CLK_PFD("pll3_pfd3_454m", "pll3_usb_otg", PFD_480, 3), -//# + CLK_PLL("pll1", "osc", SYS, PLL_ARM, DIV_SELECT, POWERDOWN, 0), CLK_PLL("pll2", "osc", GENERIC, PLL_SYS, DIV_SELECT, POWERDOWN, 0), CLK_PLL("pll3", "osc", USB, PLL_USB1, DIV_SELECT, POWER, 0), @@ -1016,7 +1011,7 @@ static struct imx6_clk imx6sx_clks[] = { CLK_PLL("pll5", "osc", AUDIO_VIDEO, PLL_VIDEO, DIV_SELECT, POWERDOWN, 0), CLK_PLL("pll6", "osc", ENET, PLL_ENET, DIV_SELECT, POWERDOWN, 5), CLK_PLL("pll7", "osc", USB, PLL_USB2, DIV_SELECT, POWER, 0), -//# + CLK_DIV("periph_clk2", "periph_clk2_sel", CBCDR, PERIPH_CLK2_PODF), CLK_DIV("periph2_clk2", "periph2_clk2_sel", CBCDR, PERIPH2_CLK2_PODF), CLK_DIV_BUSY("ocram_podf", "ocram_sel", CBCDR, AXI_PODF, CDHIPR, AXI_PODF_BUSY), @@ -1026,36 +1021,19 @@ static struct imx6_clk imx6sx_clks[] = { CLK_DIV("lcdif1_podf", "lcdif1_pred", CBCMR, GPU2D_CORE_CLK_PODF), CLK_DIV("esai_pred", "esai_sel", CS1CDR, ESAI_CLK_PRED), CLK_DIV("esai_podf", "esai_pred", CS1CDR, ESAI_CLK_PODF), -//# CLK_DIV("asrc_pred", "asrc_sel", CDCDR, SPDIF1_CLK_PRED), -//# CLK_DIV("asrc_podf", "asrc_pred", CDCDR, SPDIF1_CLK_PODF), CLK_DIV("spdif_pred", "spdif_sel", CDCDR, SPDIF0_CLK_PRED), CLK_DIV("spdif_podf", "spdif_pred", CDCDR, SPDIF0_CLK_PODF), CLK_DIV("audio_pred", "audio_sel", CDCDR, SPDIF1_CLK_PRED), CLK_DIV("audio_podf", "audio_pred", CDCDR, SPDIF1_CLK_PODF), -//# CLK_DIV("ecspi_root", "pll3_60m", CSCDR2, ECSPI_CLK_PODF), -//# CLK_DIV("can_root", "pll3_60m", CSCMR2, CAN_CLK_PODF), CLK_DIV("vid_podf", "vid_sel", CSCMR2, VID_CLK_PODF), CLK_DIV("can_podf", "can_sel", CSCMR2, CAN_CLK_PODF), -//# CLK_DIV("uart_serial_podf", "pll3_80m", CSCDR1, UART_CLK_PODF), -//# CLK_DIV("gpu2d_core_podf", "gpu2d_core_sel", CBCMR, GPU2D_CORE_CLK_PODF), -//# CLK_DIV("gpu3d_core_podf", "gpu3d_core_sel", CBCMR, GPU3D_CORE_PODF), -//# CLK_DIV("gpu3d_shader", "gpu3d_shader_sel", CBCMR, GPU3D_SHADER_PODF), CLK_DIV("display_podf", "display_sel", CSCDR3, IPU2_HSP_PODF), CLK_DIV("csi_podf", "csi_sel", CSCDR3, IPU1_HSP_PODF), -//# CLK_DIV("ipu1_podf", "ipu1_sel", CSCDR3, IPU1_HSP_PODF), -//# CLK_DIV("ipu2_podf", "ipu2_sel", CSCDR3, IPU2_HSP_PODF), -//# CLK_DIV("ldb_di0_podf",
CVS commit: src/sys/arch/arm/nxp
Module Name:src Committed By: bouyer Date: Fri May 5 09:34:10 UTC 2023 Modified Files: src/sys/arch/arm/nxp: imx6sx_clk.c Log Message: remove commented out entries, leftover from the imx6q ccm code. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6sx_clk.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/arm/nxp
Module Name:src Committed By: bouyer Date: Fri May 5 09:29:35 UTC 2023 Modified Files: src/sys/arch/arm/nxp: imx6sx_clk.c Log Message: Fix typo, preventing i2c4 from attaching To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6sx_clk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/nxp/imx6sx_clk.c diff -u src/sys/arch/arm/nxp/imx6sx_clk.c:1.1 src/sys/arch/arm/nxp/imx6sx_clk.c:1.2 --- src/sys/arch/arm/nxp/imx6sx_clk.c:1.1 Thu May 4 13:25:07 2023 +++ src/sys/arch/arm/nxp/imx6sx_clk.c Fri May 5 09:29:35 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: imx6sx_clk.c,v 1.1 2023/05/04 13:25:07 bouyer Exp $ */ +/* $NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.1 2023/05/04 13:25:07 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $"); #include "opt_fdt.h" @@ -1297,7 +1297,7 @@ static struct imx6_clk imx6sx_clks[] = { CLK_GATE("pwm8", "perclk", CCM, CCGR6, PWM8_CLK_ENABLE), CLK_GATE("vadc", "vid_podf", CCM, CCGR6, VADC_CLK_ENABLE), CLK_GATE("gis", "display_podf", CCM, CCGR6, GIS_CLK_ENABLE), - CLK_GATE("i2cs4", "perclk", CCM, CCGR6, I2CS4_CLK_ENABLE), + CLK_GATE("i2c4", "perclk", CCM, CCGR6, I2CS4_CLK_ENABLE), CLK_GATE("pwm5", "perclk", CCM, CCGR6, PWM5_CLK_ENABLE), CLK_GATE("pwm6", "perclk", CCM, CCGR6, PWM6_CLK_ENABLE), CLK_GATE("pwm7", "perclk", CCM, CCGR6, PWM7_CLK_ENABLE),
CVS commit: src/sys/arch/arm/nxp
Module Name:src Committed By: bouyer Date: Fri May 5 09:29:35 UTC 2023 Modified Files: src/sys/arch/arm/nxp: imx6sx_clk.c Log Message: Fix typo, preventing i2c4 from attaching To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6sx_clk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.