From 2390146d94760232970fc8609ede4e398be50a92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 28 Oct 2026 17:46:53 +0100 Subject: [PATCH] automatically discard stderr when running via inetd --- cgilite.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cgilite.sh b/cgilite.sh index f261f9c..0d12260 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -3,7 +3,7 @@ # This is CGIlite. # A collection of posix shell functions for writing CGI scripts. -# Copyright 2017 - 2023, 2025 Paul Hänsch +# Copyright 2017 - 2023, 2025 - 2026 Paul Hänsch # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -52,6 +52,11 @@ _DATA="${_DATA:-${PWD:-.}}" _EXEC="${_EXEC%/}" _DATA="${_DATA%/}" _BASE="${_BASE%/}" # Do not set DEBUG here, because it will increase log level +# discard stderr when running via inetd (relies on undocumented env var?) +if [ -z "$DEBUG" -a -n "$inetd_dummy" ]; then + exec 2>/dev/null +fi + export _EXEC _DATA _BASE # Carriage Return and Line Break characters for convenience -- 2.47.3