From 26b65a2f4a33463b28d15419159f49569a61d003 Mon Sep 17 00:00:00 2001
From: Wolfgang Walther <walther@technowledgy.de>
Date: Mon, 25 Mar 2024 21:08:39 +0100
Subject: [PATCH 2/5] Allow disabling ps status display via CPPFLAGS

The PS_USE_NONE is deemed the safest choice and thus the default if none of
the other options can safely be taken.  However this option is also rarely
tested, if at all.

This change allows to explicitly build with CPPFLAGS=-DPS_USE_NONE for two
reasons:
- This can be used to have an animal in the buildfarm actually build this
  code path.
- This will allow us to possibly change the default to PS_USE_CLOBBER_ARGV
  later and still have an escape hatch in case users report problems with
  that default.

Suggested by Andrew Dunstan.
---
 src/backend/utils/misc/ps_status.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index 7532af17dbb..d3513b22693 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -46,6 +46,8 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
  *	   don't update ps display
  *	   (This is the default, as it is safest.)
  */
+#ifndef PS_USE_NONE
+
 #if defined(HAVE_SETPROCTITLE_FAST)
 #define PS_USE_SETPROCTITLE_FAST
 #elif defined(HAVE_SETPROCTITLE)
@@ -58,6 +60,7 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
 #define PS_USE_NONE
 #endif
 
+#endif							/* not PS_USE_NONE */
 
 /* Different systems want the buffer padded differently */
 #if defined(__linux__) || defined(__darwin__)
-- 
2.44.0

