[ovs-git] Open vSwitch: fatal-signal: SIGPIPE for Windows. (master)

dev at openvswitch.org dev at openvswitch.org
Wed Feb 26 20:47:45 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  8a777cf663fc9c6fb3789a3fecebbe615eef8b33 (commit)
       via  0c10054023f8445ae698b650b4e901924a1cc194 (commit)
       via  a19a3a9fc32f7a115e7e7bc6895355c10806d13b (commit)
       via  60567113f79bd17fbe9f773d6c9416671a95ee88 (commit)
       via  84a6cbae3684abe57733ea8e297eb5c63358908a (commit)
      from  278aa4c5c86b3b50102c3157ca5f7046dc2b4d8b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8a777cf663fc9c6fb3789a3fecebbe615eef8b33
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8a777cf663fc9c6fb3789a3fecebbe615eef8b33
Author: Gurucharan Shetty <gshetty at nicira.com>
		
fatal-signal: SIGPIPE for Windows.
		
Windows does not have a SIGPIPE. We ignore SIGPIPE for
Linux. To compile on Windows, carve out a new function
to ignore SIGPIPE on Linux.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 0c10054023f8445ae698b650b4e901924a1cc194
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0c10054023f8445ae698b650b4e901924a1cc194
Author: Gurucharan Shetty <gshetty at nicira.com>
		
fatal-signal: Handle SIGINT for Windows.
		
Ctrl+C signals are a special case for Windows and can
be handled by registering a handle through
SetConsoleCtrlHandler() routine. This is only useful
when we run it directly on console and not as services in
the background.

Once we get a Ctrl+C signal, we call the cleanup functions
and then exit.

One thing to know here is that MinGW terminal handles
Ctrl+C signal differently (and looks a little buggy. I see
it exiting the handler midway with some sort of timeout).
So this implementation is only useful when run on Windows
terminal. Since we only use MinGW for compilation and
eventually to run unit tests, it should be okay. (The unit
tests would ideally use windows services and not expect
Ctrl+C)

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit a19a3a9fc32f7a115e7e7bc6895355c10806d13b
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=a19a3a9fc32f7a115e7e7bc6895355c10806d13b
Author: Gurucharan Shetty <gshetty at nicira.com>
		
socket-util: pipe for Windows.
		
Windows does have pipes (the interface is a little different).
We mostly use pipes in Linux to synchronize between parent and
children and also to handle fatal signals and then wake from poll_loop().

For Windows, we are using events for the same purpose. So don't
implement pipes for Windows.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 60567113f79bd17fbe9f773d6c9416671a95ee88
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=60567113f79bd17fbe9f773d6c9416671a95ee88
Author: Gurucharan Shetty <gshetty at nicira.com>
		
signals: Don't compile for Windows.
		
There are no users in Windows for any of the
function in signals.c

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


commit 84a6cbae3684abe57733ea8e297eb5c63358908a
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=84a6cbae3684abe57733ea8e297eb5c63358908a
Author: Gurucharan Shetty <gshetty at nicira.com>
		
fatal-signal: Fatal signal handling for Windows.
		
Windows does not have a SIGHUP or SIGALRM. It does have
a SIGINT and SIGTERM. The documentation at msdn says that
SIGINT is not supported for win32 applications because
WIN32 operating systems generate a new thread to specifically
handle Ctrl+C.

This commit handles SIGTERM for Windows. The documentation also
states that nothing generates SIGTERM in Windows, but one can
use raise(SIGTERM) to manage it. The idea for handling SIGTERM
for Windows is to just have a place holder if there is need to
raise() a signal for some other purpose.

We use SIGALRM in timeval.c if we wake up from a sleep after
'deadline'. For Windows, print an error message and then
use SIGTERM.

There is an atexit() function for Windows, so we can call cleanup
functions during exit.

An upcoming commit separately handles Ctrl+C so that we can call
clean up functions for that use case.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 lib/automake.mk         |    4 ++--
 lib/fatal-signal.c      |   52 ++++++++++++++++++++++++++++++++++++++++++++++-
 lib/fatal-signal.h      |    1 +
 lib/socket-util.c       |    2 ++
 lib/socket-util.h       |    2 ++
 lib/timeval.c           |    5 +++++
 ovsdb/ovsdb-client.c    |    3 ++-
 ovsdb/ovsdb-server.c    |    3 ++-
 ovsdb/ovsdb-tool.c      |    3 ++-
 tests/test-controller.c |    3 ++-
 tests/test-vconn.c      |    3 ++-
 utilities/ovs-dpctl.c   |    3 ++-
 utilities/ovs-ofctl.c   |    3 ++-
 utilities/ovs-vsctl.c   |    3 ++-
 vswitchd/ovs-vswitchd.c |    3 ++-
 vtep/vtep-ctl.c         |    3 ++-
 16 files changed, 83 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list