summaryrefslogtreecommitdiff
path: root/winrc/win_svc.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2016-09-03 15:08:13 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2016-09-03 15:08:13 +0000
commita6533d88996e7570cf04db0d99b6012d25a953d3 (patch)
treecb1552d6fa59b30201907edc56208f6fe720c283 /winrc/win_svc.c
parent21d2013cbd382bc99b9c1a31146ec76a2792b92c (diff)
downloadsrc-test2-a6533d88996e7570cf04db0d99b6012d25a953d3.tar.gz
src-test2-a6533d88996e7570cf04db0d99b6012d25a953d3.zip
Notes
Diffstat (limited to 'winrc/win_svc.c')
-rw-r--r--winrc/win_svc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/winrc/win_svc.c b/winrc/win_svc.c
index 9d6926dbe590..74ace69fb19e 100644
--- a/winrc/win_svc.c
+++ b/winrc/win_svc.c
@@ -51,7 +51,7 @@
#include "daemon/remote.h"
#include "util/config_file.h"
#include "util/netevent.h"
-#include "util/winsock_event.h"
+#include "util/ub_event.h"
/** global service status */
static SERVICE_STATUS service_status;
@@ -60,7 +60,7 @@ static SERVICE_STATUS_HANDLE service_status_handle;
/** global service stop event */
static WSAEVENT service_stop_event = NULL;
/** event struct for stop callbacks */
-static struct event service_stop_ev;
+static struct ub_event* service_stop_ev = NULL;
/** if stop even means shutdown or restart */
static int service_stop_shutdown = 0;
/** config file to open. global communication to service_main() */
@@ -453,9 +453,9 @@ service_main(DWORD ATTR_UNUSED(argc), LPTSTR* ATTR_UNUSED(argv))
/* exit */
verbose(VERB_ALGO, "winservice - cleanup.");
report_status(SERVICE_STOP_PENDING, NO_ERROR, 0);
+ if(service_stop_event) (void)WSACloseEvent(service_stop_event);
service_deinit(daemon, cfg);
free(service_cfgfile);
- if(service_stop_event) (void)WSACloseEvent(service_stop_event);
verbose(VERB_QUERY, "winservice - full stop");
report_status(SERVICE_STOPPED, NO_ERROR, 0);
}
@@ -600,9 +600,9 @@ void wsvc_setup_worker(struct worker* worker)
/* if not started with -w service, do nothing */
if(!service_stop_event)
return;
- if(!winsock_register_wsaevent(comm_base_internal(worker->base),
- &service_stop_ev, service_stop_event,
- &worker_win_stop_cb, worker)) {
+ if(!(service_stop_ev = ub_winsock_register_wsaevent(
+ comm_base_internal(worker->base), service_stop_event,
+ &worker_win_stop_cb, worker))) {
fatal_exit("could not register wsaevent");
return;
}