[ovs-dev] [PATCH V11 02/17] python tests: Register signal handlers only on supported types on Windows

Guru Shetty guru at ovn.org
Wed Aug 3 15:36:34 UTC 2016


On 2 August 2016 at 10:45, Paul Boca <pboca at cloudbasesolutions.com> wrote:

> SIGHUP and SIGALRM are not available on Windows.
>
> Signed-off-by: Paul-Daniel Boca <pboca at cloudbasesolutions.com>
> Acked-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
>
Applied.


> ---
> V2: Fixed Python function inet_open_active, treat WSAEWOULDBLOCK error as
>     EINPROGRESS on Windows
> V3: No changes
> V4: No changes
> V5: No changes
> V6: No changes
> V7: Simplified the signal handlers code
> V8: No changes
> V9: No changes
> V10: No changes
> V11: No changes
> ---
>  python/ovs/fatal_signal.py | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/python/ovs/fatal_signal.py b/python/ovs/fatal_signal.py
> index 14605ac..73e4be6 100644
> --- a/python/ovs/fatal_signal.py
> +++ b/python/ovs/fatal_signal.py
> @@ -16,6 +16,7 @@ import atexit
>  import os
>  import signal
>  import sys
> +
>  import ovs.vlog
>
>  _hooks = []
> @@ -128,9 +129,13 @@ def _init():
>      global _inited
>      if not _inited:
>          _inited = True
> +        if sys.platform == "win32":
> +            signals = [signal.SIGTERM, signal.SIGINT]
> +        else:
> +            signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP,
> +                       signal.SIGALRM]
>
> -        for signr in (signal.SIGTERM, signal.SIGINT,
> -                      signal.SIGHUP, signal.SIGALRM):
> +        for signr in signals:
>              if signal.getsignal(signr) == signal.SIG_DFL:
>                  signal.signal(signr, _signal_handler)
>          atexit.register(_atexit_handler)
> --
> 2.7.2.windows.1
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list