Skip to content

Commit

Permalink
Improves code syntax for platform killing [GH-196]
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Jun 9, 2020
1 parent 373afdc commit d0a1f1a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/.funcs.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,21 @@ function conv() {
iconv -f "$from" -t "$to" | tr -d \\r
}

# Print last return code.
get_return() {
printf "%d" $?
}

# Print last negated return code.
get_return_neg() {
printf "%d" $(( 1-$? ))
}

# Checks if process is running.
is_process_up() {
local process=${1:-terminal}
! WINEDEBUG=-all winedbg --command 'info proc' | grep -q "$process"
printf "%d" $?
WINEDEBUG=-all winedbg --command 'info proc' | grep -q "$process"
get_return_neg
}

# Restore IFS.
Expand Down

0 comments on commit d0a1f1a

Please sign in to comment.