Skip to content

Commit

Permalink
hotplug/Linux: Fix locking in tools/hotplug/Linux/locking.sh
Browse files Browse the repository at this point in the history
The claim_lock() function would fail in the perl code with:

  Invalid argument at -e line 2.

because the Perl snippet opens for reading the file descriptor, which
was earlier opened for write (append).

Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
  • Loading branch information
Jajcus committed Nov 14, 2012
1 parent d289126 commit 5c7d896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/hotplug/Linux/locking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ claim_lock()
# See below for a correctness proof.
local rightfile
while true; do
eval "exec $_lockfd>>$_lockfile"
eval "exec $_lockfd<>$_lockfile"
flock -x $_lockfd || return $?
# We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
# use bash's test -ef because those all go through what is
Expand Down

0 comments on commit 5c7d896

Please sign in to comment.