On Mon, Feb 11, 2019 at 05:57:27PM +0200, Alin Gabriel Serdean wrote: > Using python `sys.exit(-1)` on Windows produces mixed results. > Let's take the following results from different shells: > CMD > >python -c "import sys; sys.exit(-1)" & echo %errorlevel% > 1 > MSYS > $ python -c "import sys; sys.exit(-1)" && echo $? > 0 > WSL > $ python -c "import sys; sys.exit(-1)"; echo $? > 255 > > this results in the following tests to fail: > checkpatch > > 10: checkpatch - sign-offs FAILED (checkpatch.at:32) > 11: checkpatch - parenthesized constructs FAILED (checkpatch.at:32) > 12: checkpatch - parenthesized constructs - for FAILED (checkpatch.at:32) > 13: checkpatch - comments FAILED (checkpatch.at:32) > > because of: > ./checkpatch.at:32: exit code was 0, expected 255 > > This patch introduces a positive constant for the default exit code. > > Signed-off-by: Alin Gabriel Serdean <aserd...@ovn.org> > Acked-by: Ben Pfaff <b...@ovn.org> > Acked-by: Aaron Conole <acon...@redhat.com>
I'm pretty sure that this is just for exit on failure, so probably EXIT_FAILURE (or similar) would be a better name. I'm not sure why we're using -1 (or 255). Most OVS utilities, and most Unix-like software in general, use exit status 1 on failure. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev