summaryrefslogtreecommitdiff
path: root/lib/daemon-windows.c
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2014-04-14 12:57:53 -0700
committerGurucharan Shetty <gshetty@nicira.com>2014-04-22 15:17:44 -0700
commit69b17834a47300d13e86c680f03800d107ab9b1e (patch)
treef4cc0f70ba1074273565b49492538c0426cbe82a /lib/daemon-windows.c
parente3f512b07c11de6b297050bb969fd0d8a07f9357 (diff)
downloadopenvswitch-69b17834a47300d13e86c680f03800d107ab9b1e.tar.gz
daemon-windows: Rename service variables.
Sa far, we are using variable 'detach' to indicate whether the option "--service" has been set. We were using variable 'detached' to indicate that the daemon is being called from the Windows services manager. An upcoming commit introduces command line option "--detach" for daemons running on Windows. This will cause confusion with variable names. Therefore, rename the variables. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/daemon-windows.c')
-rw-r--r--lib/daemon-windows.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
index da0bd118a..a00278ebb 100644
--- a/lib/daemon-windows.c
+++ b/lib/daemon-windows.c
@@ -23,8 +23,8 @@
VLOG_DEFINE_THIS_MODULE(daemon);
-static bool detach; /* Was --service specified? */
-static bool detached; /* Have we already detached? */
+static bool service_create; /* Was --service specified? */
+static bool service_started; /* Have we dispatched service to start? */
/* --service-monitor: Should the service be restarted if it dies
* unexpectedly? */
@@ -77,10 +77,10 @@ service_start(int *argcp, char **argvp[])
{NULL, NULL}
};
- /* 'detached' is 'false' when service_start() is called the first time.
- * It is 'true', when it is called the second time by the Windows services
- * manager. */
- if (detached) {
+ /* 'service_started' is 'false' when service_start() is called the first
+ * time. It is 'true', when it is called the second time by the Windows
+ * services manager. */
+ if (service_started) {
init_service_status();
wevent = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -133,14 +133,14 @@ service_start(int *argcp, char **argvp[])
* options before the call-back from the service control manager. */
for (i = 0; i < argc; i ++) {
if (!strcmp(argv[i], "--service")) {
- detach = true;
+ service_create = true;
} else if (!strcmp(argv[i], "--service-monitor")) {
monitor = true;
}
}
/* If '--service' is not a command line option, run in foreground. */
- if (!detach) {
+ if (!service_create) {
return;
}
@@ -149,7 +149,7 @@ service_start(int *argcp, char **argvp[])
* script. */
check_service();
- detached = true;
+ service_started = true;
/* StartServiceCtrlDispatcher blocks and returns after the service is
* stopped. */
@@ -184,7 +184,7 @@ control_handler(DWORD request)
bool
should_service_stop(void)
{
- if (detached) {
+ if (service_started) {
if (service_status.dwCurrentState != SERVICE_RUNNING) {
return true;
} else {