|
4 | 4 | * |
5 | 5 | * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group |
6 | 6 | * |
7 | | - * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.71 2006/08/21 10:48:21 meskes Exp $ |
| 7 | + * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.72 2006/09/24 16:59:45 tgl Exp $ |
8 | 8 | * |
9 | 9 | *------------------------------------------------------------------------- |
10 | 10 | */ |
@@ -1277,7 +1277,15 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo) |
1277 | 1277 | /* Verify that we found all functions */ |
1278 | 1278 | if (_IsProcessInJob==NULL||_CreateJobObject==NULL||_SetInformationJobObject==NULL||_AssignProcessToJobObject==NULL||_QueryInformationJobObject==NULL) |
1279 | 1279 | { |
1280 | | -write_stderr("WARNING: Unable to locate all job object functions in system API!\n"); |
| 1280 | +/* IsProcessInJob() is not available on < WinXP, so there is no need to log the error every time in that case */ |
| 1281 | +OSVERSIONINFOosv; |
| 1282 | + |
| 1283 | +osv.dwOSVersionInfoSize=sizeof(osv); |
| 1284 | +if (!GetVersionEx(&osv)||/* could not get version */ |
| 1285 | +(osv.dwMajorVersion==5&&osv.dwMinorVersion>0)||/* 5.1=xp, 5.2=2003, etc */ |
| 1286 | +osv.dwMajorVersion>5)/* anything newer should have the API */ |
| 1287 | +/* Log error if we can't get version, or if we're on WinXP/2003 or newer */ |
| 1288 | +write_stderr("WARNING: Unable to locate all job object functions in system API!\n"); |
1281 | 1289 | } |
1282 | 1290 | else |
1283 | 1291 | { |
|