[ovs-dev] [PATCH v2 4/4] ovs-tcpdump: Fix error handling when parsing parameter.

Aaron Conole aconole at redhat.com
Mon Nov 14 15:39:32 UTC 2016


Nick,

nickcooper-zhangtonghao <nic at opencloud.tech> writes:

> Signed-off-by: nickcooper-zhangtonghao <nic at opencloud.tech>
> ---
>  utilities/ovs-tcpdump.in | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
> index 96aa1e2..d984a39 100755
> --- a/utilities/ovs-tcpdump.in
> +++ b/utilities/ovs-tcpdump.in
> @@ -433,7 +433,9 @@ def main():
>              print(data)
>          raise KeyboardInterrupt
>      except KeyboardInterrupt:
> -        pipes.terminate()
> +        if pipes.poll() is None:
> +            pipes.terminate()
> +

Thanks for the work on this - do you think it would be okay to also add
something like:

sys.exit(pipes.returncode)

Or even:

if pipes.returncode < 0:
   os.kill(os.getpid(), signal.SIGABRT)
else:
   sys.exit(pipes.returncode)

?

Either way, the change you have above should be applied, so:

Acked-by: Aaron Conole <aconole at redhat.com>


More information about the dev mailing list