#include "dirs.h"
#include "fatal-signal.h"
#include "ovs-thread.h"
-#include "poll-loop.h"
+#include "openvswitch/poll-loop.h"
#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(daemon_windows);
"unexpected failure. \n");
}
+/* Sets up a following call to service_start() to detach from the foreground
+ * session, running this process in the background. */
+void
+set_detach(void)
+{
+ detach = true;
+}
+
/* Registers the call-back and configures the actions in case of a failure
* with the Windows services manager. */
void
/* We are only interested in the '--detach' and '--pipe-handle'. */
for (i = 0; i < argc; i ++) {
- if (!strcmp(argv[i], "--detach")) {
+ if (!detach && !strcmp(argv[i], "--detach")) {
detach = true;
} else if (!strncmp(argv[i], "--pipe-handle", 13)) {
/* If running as a child, return. */