summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-09-24 16:59:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-09-24 16:59:45 +0000
commitccfafb4716911b04e78cb03a46f4995e304762ec (patch)
treecd948307782cef6106ddd8b112d6f9d640dcb5e6 /src
parentbbed6678f312fb9a81a0f7548131607b6f50c59a (diff)
Suppress useless warning on pre-XP versions of Windows. Magnus
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_ctl/pg_ctl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index e51d3668c2f..c94fe04a54f 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.71 2006/08/21 10:48:21 meskes Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.72 2006/09/24 16:59:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1277,7 +1277,15 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo)
/* Verify that we found all functions */
if (_IsProcessInJob == NULL || _CreateJobObject == NULL || _SetInformationJobObject == NULL || _AssignProcessToJobObject == NULL || _QueryInformationJobObject == NULL)
{
- write_stderr("WARNING: Unable to locate all job object functions in system API!\n");
+ /* IsProcessInJob() is not available on < WinXP, so there is no need to log the error every time in that case */
+ OSVERSIONINFO osv;
+
+ osv.dwOSVersionInfoSize = sizeof(osv);
+ if (!GetVersionEx(&osv) || /* could not get version */
+ (osv.dwMajorVersion == 5 && osv.dwMinorVersion > 0) || /* 5.1=xp, 5.2=2003, etc */
+ osv.dwMajorVersion > 5) /* anything newer should have the API */
+ /* Log error if we can't get version, or if we're on WinXP/2003 or newer */
+ write_stderr("WARNING: Unable to locate all job object functions in system API!\n");
}
else
{