From: Ondřej Surý Date: Mon, 14 May 2018 05:54:23 +0000 (+0200) Subject: Add notice about closing stdout/stderr file descriptors to style.md X-Git-Tag: v9.13.0~18^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=174d00fbb876a712b40ce7bece228a17a721d647;p=thirdparty%2Fbind9.git Add notice about closing stdout/stderr file descriptors to style.md --- diff --git a/doc/dev/style.md b/doc/dev/style.md index 8c74dcebce9..45c481eb90f 100644 --- a/doc/dev/style.md +++ b/doc/dev/style.md @@ -761,4 +761,6 @@ Bash should be avoided. Some pitfalls to avoid: statement, or use `"cat << EOF"`. * To set a variable from outside awk, use `"awk '{...}' var=value"` rather than `"awk -vvar=value '{...}'"` - +* Don't close stdout/stderr descriptors (`>&-`), but redirect them to /dev/null + instead (`>/dev/null`) as the closed descriptor might get reused leading to + unpredictable behaviour when using `fprintf(stderr, ...)`