git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
May 31, 2016, 23:05 UTC
Message-ID
<20160531230547.GC4585@sigill.intra.peff.net>
In-Reply-To
<xmqq60tt3k4f.fsf@gitster.mtv.corp.google.com>
On Tue, May 31, 2016 at 04:04:00PM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> 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@pobox.com>
> ---
> 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
Previous: Junio C Hamano
Message 6 of 6 in “t0005: ksh93 portability workaround”
  1. t0005: ksh93 portability workaroundJunio C Hamano, May 31, 2016
  2. Eric SunshineMay 31, 2016
  3. Jeff KingMay 31, 2016
  4. Junio C HamanoMay 31, 2016
  5. t/lib-git-daemon: ksh portability workaroundJunio C Hamano, May 31, 2016
  6. Jeff KingMay 31, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.