]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/daemon-windows.c
cirrus: Use FreeBSD 12.2.
[mirror_ovs.git] / lib / daemon-windows.c
index 2ba62d21abf93a00a077e48ee6fdfcf12845db10..7e5f264f5b9e7de52f51c5e16c2e887e2ba1bf4d 100644 (file)
@@ -24,7 +24,7 @@
 #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);
@@ -82,6 +82,14 @@ daemon_usage(void)
                                    "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
@@ -357,7 +365,7 @@ detach_process(int argc, char *argv[])
 
     /* 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. */