services: Check process status to determine if service has terminated.

This commit is contained in:
Piotr Caban 2011-12-12 11:04:07 +01:00 committed by Alexandre Julliard
parent c11e163eb7
commit b9797b5caa

View file

@ -807,7 +807,7 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
if (err != ERROR_SUCCESS)
return err;
if (service->control_pipe != INVALID_HANDLE_VALUE)
if (WaitForSingleObject(service->process, 0) == WAIT_TIMEOUT)
{
scmdatabase_unlock_startup(service->db);
return ERROR_SERVICE_ALREADY_RUNNING;