Skip to content

Commit

Permalink
POSIX shell does not require the local builtin
Browse files Browse the repository at this point in the history
And sadly some ksh variants don't support it.
As keychain hardly uses it, just stop using it.
  • Loading branch information
rsmarples committed Jan 20, 2018
1 parent 03c89f2 commit 2a50620
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keychain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ lockfile() {
# it returns 0. If it fails, it returns 1. This function retuns immediately
# and only tries to acquire the lock once.

local tmpfile="$lockf.$$"
tmpfile="$lockf.$$"

echo $$ >"$tmpfile" 2>/dev/null || exit
if ln "$tmpfile" "$lockf" 2>/dev/null; then
Expand Down Expand Up @@ -205,7 +205,7 @@ takelock() {
# First attempt:
lockfile && return 0

local counter=0
counter=0
mesg "Waiting $lockwait seconds for lock..."
while [ "$counter" -lt "$(( $lockwait * 2 ))" ]
do
Expand Down

0 comments on commit 2a50620

Please sign in to comment.