[ovs-dev] [PATCH V2 4/4] tests: Fix fail of OVS_APP_EXIT_AND_WAIT on Windows
Ben Pfaff
blp at ovn.org
Fri Jun 3 04:43:36 UTC 2016
On Thu, Jun 02, 2016 at 09:37:01PM -0700, Ben Pfaff wrote:
> On Thu, Jun 02, 2016 at 06:41:23PM -0700, Joe Stringer wrote:
> > On the other hand, if that command returned effectively an empty
> > string, then I'd expect the kill command would become something like
> > "kill -0", which should print the usage and return a non-zero exit
> > code.
>
> That's what happens on a POSIX system, but for Windows, in
> tests/ovs-macros.at, we have a "kill"-emulating shell function that
> fails to faithfully reproduce that behavior:
>
> kill () {
> signal=
> retval=0
> for arg; do
> case $arg in
> -*) signal=$arg ;;
> [1-9][0-9]*)
> # tasklist always returns 0.
> # If pid does exist, there will be a line with the pid.
> if tasklist //fi "PID eq $arg" | grep $arg >/dev/null; then
> if test "X$signal" != "X-0"; then
> tskill $arg
> fi
> else
> retval=1
> fi
> ;;
> esac
> done
> return $retval
>
> Perhaps we should add something like:
>
> if test $# = 0; then
> echo >&2 "kill: usage: kill [-signum] pid..."
> return 1
> fi
Actually that's still incomplete, of course, because "test $# = 0" would
ignore "kill -0".
More information about the dev
mailing list