Also, fflush(stderr) when we raise a signal. The test
this commit is changing would fail otherwise.

Signed-off-by: Gurucharan Shetty <gshe...@nicira.com>
---
 lib/fatal-signal.c |    1 +
 tests/ovs-vsctl.at |   16 ++++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c
index ebafc90..eff007d 100644
--- a/lib/fatal-signal.c
+++ b/lib/fatal-signal.c
@@ -199,6 +199,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 */
diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
index f27ffbd..135f768 100644
--- a/tests/ovs-vsctl.at
+++ b/tests/ovs-vsctl.at
@@ -159,8 +159,14 @@ AT_CHECK(
   [0], [], [stderr])
 AT_CHECK([grep -c 'terminating with signal' stderr], [0], [1
 ])
-AT_CHECK([kill -l `cat status`], [0], [ALRM
+if test "$IS_WIN32" = "yes"; then
+  AT_CHECK([cat status], [0], [3
 ])
+else
+  # 128 + SIGALRM
+  AT_CHECK([cat status], [0], [142
+])
+fi
 
 dnl Without --retry, we should retry for passive connections.
 AT_CHECK(
@@ -169,8 +175,14 @@ AT_CHECK(
   [0], [], [stderr])
 AT_CHECK([grep -c 'terminating with signal' stderr], [0], [1
 ])
-AT_CHECK([kill -l `cat status`], [0], [ALRM
+if test "$IS_WIN32" = "yes"; then
+  AT_CHECK([cat status], [0], [3
+])
+else
+  # 128 + SIGALRM
+  AT_CHECK([cat status], [0], [142
 ])
+fi
 AT_CLEANUP
 
 dnl ----------------------------------------------------------------------
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to