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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 31, 2016, 23:04 UTC
Message-ID
<xmqq60tt3k4f.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqinxt3kwq.fsf@gitster.mtv.corp.google.com>

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
 	then
 		error "git daemon exited with status: $ret"
 	fi
Previous: Junio C HamanoNext: Jeff King
Message 5 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.