Re: [PATCH] t/lib-git-daemon: ksh portability workaround

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 31, 2016 at 04:04:00PM -0700, Junio C Hamano wrote:

> The "git daemon" test checks with what status the daemon exits when
> we terminate it, and we expect that we can observe death by SIGTERM.
> 
> We forgot that ksh adds 256, unlike 128 that are used by other POSIX
> shells, to the signal number that caused the process to die when
> coming up with the exit status.
> 
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
> diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
> index 340534c..623b3ae 100644
> --- a/t/lib-git-daemon.sh
> +++ b/t/lib-git-daemon.sh
> @@ -83,7 +83,8 @@ stop_git_daemon() {
>  	wait "$GIT_DAEMON_PID" >&3 2>&4
>  	ret=$?
>  	# expect exit with status 143 = 128+15 for signal TERM=15
> -	if test $ret -ne 143
> +	# or 271 = 256+15 on ksh
> +	if test $ret -ne 143 && test $ret -ne 271

The presence of this patch (on top of the other one) makes me think we
should go with something like:

  test_exit_code_is

or something, and make it available via test-lib-functions.sh.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]