Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c21c658

Browse files
committed
Add error checking for starting a win32 service using pg_ctl.
1 parent 556e721 commit c21c658

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bin/pg_ctl/pg_ctl.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.50 2004/12/21 17:38:01 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.51 2004/12/21 17:58:30 momjian Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -1078,7 +1078,11 @@ pgwin32_doRunAsService(void)
10781078
SERVICE_TABLE_ENTRY st[] = {{register_servicename, pgwin32_ServiceMain},
10791079
{NULL, NULL}};
10801080

1081-
StartServiceCtrlDispatcher(st);
1081+
if (StartServiceCtrlDispatcher(st)) == 0)
1082+
{
1083+
write_stderr(_("%s: could not start service \"%s\": error code %d\n"), progname, register_servicename, (int) GetLastError());
1084+
exit(1);
1085+
}
10821086
}
10831087
#endif
10841088

0 commit comments

Comments
 (0)