aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hotplug/Linux/locking.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/hotplug/Linux/locking.sh')
-rw-r--r--tools/hotplug/Linux/locking.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index 0e2a531cb3..e34f155438 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -59,6 +59,9 @@ claim_lock()
print "y\n" if $fd_inum eq $file_inum;
' "$_lockfile" )
if [ x$rightfile = xy ]; then break; fi
+ # Some versions of bash appear to be buggy if the same
+ # $_lockfile is opened repeatedly. Close the current fd here.
+ eval "exec $_lockfd<&-"
done
}