xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Konieczny <jajcus@jajcus.net>
To: xen-devel@lists.xensource.com
Cc: Jacek Konieczny <jajcus@jajcus.net>
Subject: [PATCH] Fix locking in tools/hotplug/Linux/locking.sh
Date: Fri,  9 Nov 2012 14:56:11 +0100	[thread overview]
Message-ID: <1352469371-15457-1-git-send-email-jajcus@jajcus.net> (raw)

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

             reply	other threads:[~2012-11-09 13:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 13:56 Jacek Konieczny [this message]
2012-11-12 16:42 ` [PATCH] Fix locking in tools/hotplug/Linux/locking.sh 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352469371-15457-1-git-send-email-jajcus@jajcus.net \
    --to=jajcus@jajcus.net \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).