Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf375d5d

Browse files
committed
Cause pg_regress to invoke the temporary postmaster as 'postgres' not
'postmaster', so as not to depend on the existence of the postmastersymlink. Also, implement postmaster-still-alive and postmaster-killoperations for Windows, per Magnus.
1 parentccfafb4 commitf375d5d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.21 2006/09/19 15:36:08 tgl Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.22 2006/09/24 17:10:18 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -615,7 +615,7 @@ psql_command(const char *database, const char *query, ...)
615615
/*
616616
* Spawn a process to execute the given shell command; don't wait for it
617617
*
618-
* Returns the process ID so we can wait for it later
618+
* Returns the process ID(or HANDLE)so we can wait for it later
619619
*/
620620
staticPID_TYPE
621621
spawn_process(constchar*cmdline)
@@ -1512,7 +1512,7 @@ main(int argc, char *argv[])
15121512
*/
15131513
header(_("starting postmaster"));
15141514
snprintf(buf,sizeof(buf),
1515-
SYSTEMQUOTE"\"%s/postmaster\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1"SYSTEMQUOTE,
1515+
SYSTEMQUOTE"\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1"SYSTEMQUOTE,
15161516
bindir,temp_install,
15171517
debug ?" -d 5" :"",
15181518
hostname ?hostname :"",
@@ -1541,16 +1541,16 @@ main(int argc, char *argv[])
15411541

15421542
/*
15431543
* Fail immediately if postmaster has exited
1544-
*
1545-
* XXX is there a way to do this on Windows?
15461544
*/
15471545
#ifndefWIN32
15481546
if (kill(postmaster_pid,0)!=0)
1547+
#else
1548+
if (WaitForSingleObject(postmaster_pid,0)==WAIT_OBJECT_0)
1549+
#endif
15491550
{
15501551
fprintf(stderr,_("\n%s: postmaster failed\nExamine %s/log/postmaster.log for the reason\n"),progname,outputdir);
15511552
exit_nicely(2);
15521553
}
1553-
#endif
15541554

15551555
pg_usleep(1000000L);
15561556
}
@@ -1563,14 +1563,16 @@ main(int argc, char *argv[])
15631563
* in startup. Try to kill it ungracefully rather than leaving
15641564
* a stuck postmaster that might interfere with subsequent test
15651565
* attempts.
1566-
*
1567-
* XXX is there a way to do this on Windows?
15681566
*/
15691567
#ifndefWIN32
15701568
if (kill(postmaster_pid,SIGKILL)!=0&&
15711569
errno!=ESRCH)
15721570
fprintf(stderr,_("\n%s: could not kill failed postmaster: %s\n"),
15731571
progname,strerror(errno));
1572+
#else
1573+
if (TerminateProcess(postmaster_pid,255)==0)
1574+
fprintf(stderr,_("\n%s: could not kill failed postmaster: %lu\n"),
1575+
progname,GetLastError());
15741576
#endif
15751577

15761578
exit_nicely(2);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp