Skip to contentSkip to conversation

git-gui/gitk: Do not depend on Cygwin's "kill" command on Windows

PATCH New Sebastian Schuberth 1 participant 1 message Aug 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-gui/gitk: Do not depend on Cygwin's "kill" command on Windows

Windows does not necessarily mean Cygwin, it could also be MSYS. The latter ships with a version of "kill" that does not understand "-f". In msysgit this was addressed shipping Cygwin's version of kill.

Properly fix this by using the stock Windows "taskkill" command instead, which is available since Windows XP Professional.

---
 git-gui/git-gui.sh | 4 +---
 gitk-git/gitk      | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)
git-gui/git-gui.sh +1 -3
index b186329..a1c823e 100755
@@ -666,9 +666,7 @@ proc kill_file_process {fd} {
 
 	catch {
 		if {[is_Windows]} {
-			# Use a Cygwin-specific flag to allow killing
-			# native Windows processes
-			exec kill -f $process
+			exec taskkill /pid $process
 		} else {
 			exec kill $process
 		}
gitk-git/gitk +1 -1
index 3520bda..bfc5cfa 100755
@@ -445,7 +445,7 @@ proc stop_instance {inst} {
 	set pid [pid $fd]
 
 	if {$::tcl_platform(platform) eq {windows}} {
-	    exec kill -f $pid
+	    exec taskkill /pid $pid
 	} else {
 	    exec kill $pid
 	}
Signature · 1 line
1.8.4-mingw-3