mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
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:
1 parent
9b223b2f09
commit
e3f4dd42f6
1 file changed
+1
-1
@@ -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
|
||||
|
||||