lib: Move vlog.h to <openvswitch/vlog.h>
[cascardo/ovs.git] / lib / fatal-signal.c
index ebafc90..62acea0 100644 (file)
@@ -30,7 +30,7 @@
 #include "signals.h"
 #include "socket-util.h"
 #include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
 
 #include "type-props.h"
 
@@ -59,9 +59,12 @@ static struct hook hooks[MAX_HOOKS];
 static size_t n_hooks;
 
 static int signal_fds[2];
-static HANDLE wevent;
 static volatile sig_atomic_t stored_sig_nr = SIG_ATOMIC_MAX;
 
+#ifdef _WIN32
+static HANDLE wevent;
+#endif
+
 static struct ovs_mutex mutex;
 
 static void call_hooks(int sig_nr);
@@ -199,6 +202,7 @@ fatal_signal_run(void)
         VLOG_WARN("terminating with signal %d", (int)sig_nr);
 #endif
         call_hooks(sig_nr);
+        fflush(stderr);
 
         /* Re-raise the signal with the default handling so that the program
          * termination status reflects that we were killed by this signal */
@@ -214,7 +218,11 @@ void
 fatal_signal_wait(void)
 {
     fatal_signal_init();
-    poll_fd_wait_event(signal_fds[0], wevent, POLLIN);
+#ifdef _WIN32
+    poll_wevent_wait(wevent);
+#else
+    poll_fd_wait(signal_fds[0], POLLIN);
+#endif
 }
 
 void