0004-Update-ps-status-on-all-systems-by-default.patch

text/x-patch

Filename: 0004-Update-ps-status-on-all-systems-by-default.patch
Type: text/x-patch
Part: 3
Message: Re: Regression tests fail with musl libc because libpq.so can't be loaded

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch 0004
Subject: Update ps status on all systems by default
File+
src/backend/utils/misc/ps_status.c 5 7
From 78d0aebce3fa2722d1b6eef0c937251e8b5005ca Mon Sep 17 00:00:00 2001
From: Wolfgang Walther <walther@technowledgy.de>
Date: Mon, 25 Mar 2024 22:18:11 +0100
Subject: [PATCH 4/5] Update ps status on all systems by default

With the new approach, PS_USE_CLOBBER_ARGV does not overwrite any
environment variables anymore and can be made the default.

For the unlikely event that a system could have problems other than
the ps status not working with this, PS_USE_NONE is kept for the
moment. This can still be explicitly enabled via CPPFLAGS.
---
 src/backend/utils/misc/ps_status.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index c1161e85507..d1df1b39ee0 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -35,14 +35,14 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
  * PS_USE_SETPROCTITLE
  *	   use the function setproctitle(const char *, ...)
  *	   (other BSDs)
- * PS_USE_CLOBBER_ARGV
- *	   write over the argv area
- *	   (Linux and most SysV-like systems)
  * PS_USE_WIN32
  *	   push the string out as the name of a Windows event
+ * PS_USE_CLOBBER_ARGV
+ *	   write over the argv area
+ *	   (This is the default)
  * PS_USE_NONE
  *	   don't update ps display
- *	   (This is the default, as it is safest.)
+ *	   (This can be enabled manually with CPPFLAGS=-DPS_USE_NONE.)
  */
 #ifndef PS_USE_NONE
 
@@ -50,12 +50,10 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
 #define PS_USE_SETPROCTITLE_FAST
 #elif defined(HAVE_SETPROCTITLE)
 #define PS_USE_SETPROCTITLE
-#elif defined(__linux__) || defined(__sun) || defined(__darwin__)
-#define PS_USE_CLOBBER_ARGV
 #elif defined(WIN32)
 #define PS_USE_WIN32
 #else
-#define PS_USE_NONE
+#define PS_USE_CLOBBER_ARGV
 #endif
 
 #endif							/* not PS_USE_NONE */
-- 
2.44.0