1 commit a4ef9c9753467ae2eaeff858bcb63a5ba5337d18
2 Author: Jacek Konieczny <jajcus@jajcus.net>
3 Date: Fri Nov 9 14:47:40 2012 +0100
5 Fix locking in tools/hotplug/Linux/locking.sh
7 The claim_lock() function would fail in the perl code with:
9 Invalid argument at -e line 2.
11 because the Perl snippet opens for reading the file descriptor, which
12 was earlier opened for write (append).
14 Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
16 diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
17 index 0e2a531..5c4f365 100644
18 --- a/tools/hotplug/Linux/locking.sh
19 +++ b/tools/hotplug/Linux/locking.sh
20 @@ -44,7 +44,7 @@ claim_lock()
21 # See below for a correctness proof.
24 - eval "exec $_lockfd>>$_lockfile"
25 + eval "exec $_lockfd<>$_lockfile"
26 flock -x $_lockfd || return $?
27 # We can't just stat /dev/stdin or /proc/self/fd/$_lockfd or
28 # use bash's test -ef because those all go through what is