Module Name:    src
Committed By:   kre
Date:           Tue Nov 16 11:15:26 UTC 2021

Modified Files:
        src/tests/bin/sh: t_redir.sh

Log Message:
Fix a test that has been (unnoticed) failing ever since printf(1) was
changed to exit(1) when it detects a write error to stdout.

Running printf with stdout closed is guaranteed to generate such a
condition.

Until the previous commit, while the test case was actually failing
(stderr was expected to be empty. and was not) this was unnoticed.
We don't want the output (obviously), we also don't want the error
message, so just direct the latter to /dev/null.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.12 src/tests/bin/sh/t_redir.sh:1.13
--- src/tests/bin/sh/t_redir.sh:1.12	Tue Nov 16 11:12:14 2021
+++ src/tests/bin/sh/t_redir.sh	Tue Nov 16 11:15:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_redir.sh,v 1.12 2021/11/16 11:12:14 kre Exp $
+# $NetBSD: t_redir.sh,v 1.13 2021/11/16 11:15:26 kre Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -927,7 +927,7 @@ validate_fn_redirects_body()
 
 	echo '
 		. ./f-def || echo >&2 FAIL
-		f >&-
+		f >&- 2>/dev/null
 		printf "%s\n" stdin2
 	' | atf_check -s exit:0 -o inline:'stdin2\n' -e empty ${TEST_SH} ||
 		atf_fail "stdin2 test failure"

Reply via email to