0002-Fix-compiler-warnings.patch

text/plain

Filename: 0002-Fix-compiler-warnings.patch
Type: text/plain
Part: 1
Message: MSYS2 support

Patch

Format: format-patch
Series: patch 0002
Subject: Fix compiler warnings
File+
src/backend/utils/misc/ps_status.c 8 0
From bf5be8c29babcd86e12d9f3acfb87d391d61e187 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 11 Dec 2019 08:52:50 +0100
Subject: [PATCH 2/3] Fix compiler warnings

The PS_USE_NONE case left a couple of unused variables exposed.
---
 src/backend/utils/misc/ps_status.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index 6c851dd498..288d71d4d2 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -89,6 +89,8 @@ bool		update_process_title = true;
 #endif
 
 
+#ifndef PS_USE_NONE
+
 #ifndef PS_USE_CLOBBER_ARGV
 /* all but one option need a buffer to write their ps line in */
 #define PS_BUFFER_SIZE 256
@@ -104,6 +106,8 @@ static size_t ps_buffer_cur_len;	/* nominal strlen(ps_buffer) */
 
 static size_t ps_buffer_fixed_size; /* size of the constant prefix */
 
+#endif
+
 /* save the original argv[] location here */
 static int	save_argc;
 static char **save_argv;
@@ -420,7 +424,11 @@ get_ps_display(int *displen)
 	}
 #endif
 
+#ifdef PS_USE_NONE
+	return "";
+#else
 	*displen = (int) (ps_buffer_cur_len - ps_buffer_fixed_size);
 
 	return ps_buffer + ps_buffer_fixed_size;
+#endif
 }
-- 
2.24.0