From: Paul Hänsch Date: Wed, 28 Oct 2026 16:46:53 +0000 (+0100) Subject: automatically discard stderr when running via inetd X-Git-Url: http://git.plutz.net/?a=commitdiff_plain;h=2390146d94760232970fc8609ede4e398be50a92;p=cgilite automatically discard stderr when running via inetd --- 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