hotplug/Linux: Fix locking in tools/hotplug/Linux/locking.sh

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>
This commit is contained in:
Jacek Konieczny committed 2012-11-14 10:24:28 +00:00
1 parent 9b223b2f09
commit e3f4dd42f6
1 file changed
+1 -1
+1 -1
View File
@@ -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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.