xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix locking in tools/hotplug/Linux/locking.sh
@ 2012-11-09 13:56 Jacek Konieczny
  2012-11-12 16:42 ` Ian Campbell
  0 siblings, 1 reply; 11+ messages in thread
From: Jacek Konieczny @ 2012-11-09 13:56 UTC (permalink / raw)
  To: xen-devel; +Cc: Jacek Konieczny

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>
---
 tools/hotplug/Linux/locking.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index e34f155..122bcfb 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -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
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-11-14 10:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 13:56 [PATCH] Fix locking in tools/hotplug/Linux/locking.sh Jacek Konieczny
2012-11-12 16:42 ` Ian Campbell
2012-11-12 18:05   ` Jacek Konieczny
2012-11-12 18:07   ` Olaf Hering
2012-11-12 18:34     ` Jacek Konieczny
2012-11-12 18:40       ` Olaf Hering
2012-11-13 11:08         ` Ian Campbell
2012-11-13 13:27           ` Jacek Konieczny
2012-11-13 16:21             ` Ian Jackson
2012-11-13 16:25               ` Ian Campbell
2012-11-14 10:24                 ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).