From: Pat Thoyts Date: Sat, 14 Aug 2010 23:21:30 GMT Subject: [PATCH] git-gui: change the termination checks to avoid potential hang. Message-ID: <87iq3bh1op.fsf_-_@fox.patthoyts.tk> In-Reply-To: <20100704212439.GA1765@burratino> Supposedly the askpass utility can hang under some circumstances. This patch adjusts the Tk application to terminate properly and should avoid this problem. Reported-by: Anders Kaseorg Signed-off-by: Pat Thoyts --- git-gui--askpass | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/git-gui--askpass b/git-gui--askpass index 12e117e..8ba4779 100755 --- a/git-gui--askpass +++ b/git-gui--askpass @@ -30,16 +30,20 @@ if {!$yesno} { frame .b button .b.ok -text OK -command finish -button .b.cancel -text Cancel -command {destroy .} +button .b.cancel -text Cancel -command cancel pack .b.ok -side left -expand 1 pack .b.cancel -side right -expand 1 pack .b -side bottom -fill x -padx 10 -pady 10 bind . {focus -force .e} -bind . finish -bind . {destroy .} -bind . {exit $rc} +bind . [list .b.ok invoke] +bind . [list .b.cancel invoke] +bind . {set rc $rc} + +proc cancel {} { + set ::rc 255 +} proc finish {} { if {$::yesno} { @@ -50,10 +54,11 @@ proc finish {} { } } - set ::rc 0 puts $::answer - destroy . + set ::rc 0 } wm title . "OpenSSH" tk::PlaceWindow . +vwait rc +exit $rc -- 1.7.2.1.44.g721e7