mirror of
https://github.com/bol-van/zapret2.git
synced 2026-10-29 06:02:05 +00:00
blockcheck2: use kill -f in cygwin to speed up kill
This commit is contained in:
1 parent
bb042f734e
commit
6f63dbc3a8
1 file changed
+8
-2
+8
-2
@@ -77,9 +77,10 @@ killwait()
|
||||
|
||||
local n
|
||||
|
||||
kill $1 $2
|
||||
case "$UNAME" in
|
||||
CYGWIN)
|
||||
# do not use builtin bash kill if run under bash
|
||||
/bin/kill $1 $2
|
||||
n=1
|
||||
# wait only waits for child processes. cygstart makes process non-child
|
||||
while kill -0 "$2" 2>/dev/null; do
|
||||
@@ -92,6 +93,7 @@ killwait()
|
||||
done
|
||||
;;
|
||||
*)
|
||||
kill $1 $2
|
||||
# suppress job kill message
|
||||
wait $2 2>/dev/null
|
||||
;;
|
||||
@@ -994,8 +996,12 @@ pktws_start()
|
||||
}
|
||||
ws_kill()
|
||||
{
|
||||
local sig
|
||||
[ -z "$PID" ] || {
|
||||
killwait -9 $PID 2>/dev/null
|
||||
sig=-9
|
||||
# use fast kill using TerminateProcess() in cygwin
|
||||
[ "$UNAME" = "CYGWIN" ] && sig=-f
|
||||
killwait $sig $PID 2>/dev/null
|
||||
PID=
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user