service: change CheckServiceStatus() return type to VOID

CheckServiceStatus() return value is never used - the status
is set to global options_t struct.

While on it, remove unneccessary "false" argument
and reformat the code.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
pull/531/head
Lev Stipakov 2 years ago committed by Selva Nair
parent 7d078dd151
commit 6924b09a35

@ -487,7 +487,7 @@ HandleCopyDataMessage(const COPYDATASTRUCT *copy_data)
static void CALLBACK
ManagePersistent(HWND hwnd, UINT UNUSED msg, UINT_PTR id, DWORD UNUSED now)
{
CheckServiceStatus(false);
CheckServiceStatus();
if (o.service_state == service_connected)
{
for (int i = 0; i < o.num_configs; i++)

@ -89,13 +89,11 @@ out:
return ret;
}
int CheckServiceStatus()
VOID CheckServiceStatus()
{
SC_HANDLE schSCManager = NULL;
SC_HANDLE schService = NULL;
SERVICE_STATUS ssStatus;
BOOL ret = false;
// Open a handle to the SC Manager database.
schSCManager = OpenSCManager(
@ -131,7 +129,6 @@ int CheckServiceStatus()
if (ssStatus.dwCurrentState == SERVICE_RUNNING)
{
o.service_state = service_connected;
ret = true;
goto out;
}
else
@ -145,7 +142,6 @@ out:
CloseServiceHandle(schService);
if (schSCManager)
CloseServiceHandle(schSCManager);
return ret;
}
/* Attempt to start OpenVPN Automatc Service */

@ -19,7 +19,7 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
int CheckServiceStatus();
VOID CheckServiceStatus();
BOOL CheckIServiceStatus(BOOL warn);
/* Attempt to start OpenVPN Automatc Service */
void StartAutomaticService(void);

Loading…
Cancel
Save