aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula_lock.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_lock.rb b/Library/Homebrew/formula_lock.rb
index 3b3807fd8..0eeb27c84 100644
--- a/Library/Homebrew/formula_lock.rb
+++ b/Library/Homebrew/formula_lock.rb
@@ -1,3 +1,5 @@
+require 'fcntl'
+
class FormulaLock
LOCKDIR = HOMEBREW_CACHE_FORMULA
@@ -33,7 +35,9 @@ class FormulaLock
def get_or_create_lockfile
if @lockfile.nil? || @lockfile.closed?
- @path.open(File::RDWR | File::CREAT)
+ @lockfile = @path.open(File::RDWR | File::CREAT)
+ @lockfile.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
+ @lockfile
else
@lockfile
end