Skip to content

Commit 449593a

Browse files
committed
Fix process-status handling for OS X 10.3.
1 parent b657ded commit 449593a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/backend/utils/misc/ps_status.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* to contain some useful information. Mechanism differs wildly across
66
* platforms.
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/ps_status.c,v 1.14 2003/08/04 23:59:39 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/ps_status.c,v 1.15 2003/11/08 19:07:24 tgl Exp $
99
*
1010
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
1111
* various details abducted from various places
@@ -57,7 +57,7 @@ extern char **environ;
5757
#define PS_USE_PSTAT
5858
#elif defined(HAVE_PS_STRINGS)
5959
#define PS_USE_PS_STRINGS
60-
#elif defined(BSD) || defined(__bsdi__) || defined(__hurd__)
60+
#elif (defined(BSD) || defined(__bsdi__) || defined(__hurd__)) && !defined(__darwin__)
6161
#define PS_USE_CHANGE_ARGV
6262
#elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(ultrix) || defined(__ksr__) || defined(__osf__) || defined(__QNX__) || defined(__svr4__) || defined(__svr5__) || defined(__darwin__)
6363
#define PS_USE_CLOBBER_ARGV
@@ -143,7 +143,7 @@ save_ps_display_args(int argc, char *argv[])
143143
}
144144

145145
ps_buffer = argv[0];
146-
ps_buffer_size = end_of_area - argv[0] - 1;
146+
ps_buffer_size = end_of_area - argv[0];
147147

148148
/*
149149
* move the environment out of the way
@@ -193,7 +193,13 @@ init_ps_display(const char *username, const char *dbname,
193193
#endif /* PS_USE_CHANGE_ARGV */
194194

195195
#ifdef PS_USE_CLOBBER_ARGV
196-
save_argv[1] = NULL;
196+
{
197+
int i;
198+
199+
/* make extra argv slots point at end_of_area (a NUL) */
200+
for (i = 1; i < save_argc; i++)
201+
save_argv[i] = ps_buffer + ps_buffer_size;
202+
}
197203
#endif /* PS_USE_CLOBBER_ARGV */
198204

199205
/*

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