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

[PATCH] contrib/difftool: change trap condition from SIGINT to INT

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Jan 19, 2009, 23:38 UTC
Message-ID
<200901200038.17548.markus.heidelberg@web.de>

git-difftool worked for me on an up-to-date Gentoo Linux at home, but didn't work on a somewhat older Ubuntu Linux 7.10 at work and failed with the following error, where 'Makefile' was locally modified:

    trap: 244: SIGINT: bad trap
    external diff died, stopping at Makefile.
In 'man 1p trap' there is written:
    "The condition can be EXIT, 0 (equivalent to EXIT), or a signal
    specified using a symbolic name, without the SIG prefix, [...]"
    "Implementations may permit names with the SIG prefix or ignore case
    in signal names as an extension."
So now we do it the POSIX compliant way instead of using an extension.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 contrib/difftool/git-difftool-helper |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper
index f013726..a2eb59b 100755
--- a/contrib/difftool/git-difftool-helper
+++ b/contrib/difftool/git-difftool-helper
@@ -53,7 +53,7 @@ launch_merge_tool () {
 
 	# Create and ensure that we clean up $BACKUP
 	test -f "$MERGED" && cp -- "$MERGED" "$BACKUP"
-	trap sigint_handler SIGINT
+	trap sigint_handler INT
 
 	# $LOCAL and $REMOTE are temporary files so prompt
 	# the user with the real $MERGED name before launching $merge_tool.
-- 
1.6.1.216.g3acd
Message 1 of 1 in “contrib/difftool: change trap condition from SIGINT to INT”
  1. contrib/difftool: change trap condition from SIGINT to INTMarkus Heidelberg, Jan 19, 2009

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.