Skip to content

Commit 8c6d30f

Browse files
committed
Fix compiler warnings on MSYS2
The PS_USE_NONE case in ps_status.c left a couple of unused variables exposed. Discussion: https://www.postgresql.org/message-id/flat/6b467edc-4018-521f-ab18-171f098557ca%402ndquadrant.com
1 parent 6136e94 commit 8c6d30f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/utils/misc/ps_status.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ bool update_process_title = true;
8989
#endif
9090

9191

92+
#ifndef PS_USE_NONE
93+
9294
#ifndef PS_USE_CLOBBER_ARGV
9395
/* all but one option need a buffer to write their ps line in */
9496
#define PS_BUFFER_SIZE 256
@@ -104,6 +106,8 @@ static size_t ps_buffer_cur_len; /* nominal strlen(ps_buffer) */
104106

105107
static size_t ps_buffer_fixed_size; /* size of the constant prefix */
106108

109+
#endif /* not PS_USE_NONE */
110+
107111
/* save the original argv[] location here */
108112
static int save_argc;
109113
static char **save_argv;
@@ -420,7 +424,11 @@ get_ps_display(int *displen)
420424
}
421425
#endif
422426

427+
#ifndef PS_USE_NONE
423428
*displen = (int) (ps_buffer_cur_len - ps_buffer_fixed_size);
424429

425430
return ps_buffer + ps_buffer_fixed_size;
431+
#else
432+
return "";
433+
#endif
426434
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy