ovs-vsctl.at: Workaround lack of 'kill -l' on Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Tue, 17 Jun 2014 19:35:32 +0000 (12:35 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Fri, 27 Jun 2014 00:01:03 +0000 (17:01 -0700)
Also, fflush(stderr) when we raise a signal. The test
this commit is changing would fail otherwise.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/fatal-signal.c
tests/ovs-vsctl.at

index ebafc90..eff007d 100644 (file)
@@ -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 */
index f27ffbd..135f768 100644 (file)
@@ -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 ----------------------------------------------------------------------