Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
systemsmanagement:chef:10
rubygem-chef
CHEF-867-use-cloexec-if-we-can.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File CHEF-867-use-cloexec-if-we-can.patch of Package rubygem-chef
From c30083f59dd2860eebd7ca269f1e36837d6a58e6 Mon Sep 17 00:00:00 2001 From: Lamont Granquist <lamont@opscode.com> Date: Fri, 14 Jun 2013 14:43:36 -0700 Subject: [PATCH] use F_CLOEXEC if we can --- lib/chef/run_lock.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/chef/run_lock.rb b/lib/chef/run_lock.rb index c63895e..50371d9 100644 --- a/lib/chef/run_lock.rb +++ b/lib/chef/run_lock.rb @@ -16,6 +16,7 @@ # limitations under the License. require 'chef/mixin/create_path' +require 'fcntl' class Chef @@ -55,6 +56,10 @@ def acquire # ensure the runlock_file path exists create_path(File.dirname(runlock_file)) @runlock = File.open(runlock_file,'w+') + # if we support FD_CLOEXEC (linux, !windows), then use it. + if Fcntl.const_defined?('F_SETFD') && Fcntl.const_defined?('FD_CLOEXEC') + @runlock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) + end unless runlock.flock(File::LOCK_EX|File::LOCK_NB) # Another chef client running... runpid = runlock.read.strip.chomp -- 1.8.5.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor