[oe-commits] Chris Larson : utils.bbclass: set close_fds= True by default for the popen helper
git version control
git at git.openembedded.org
Thu Jun 10 18:35:15 UTC 2010
Module: openembedded.git
Branch: org.openembedded.dev
Commit: f6ac2d399aae6c6aad9b24a96abc860229c4a603
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=f6ac2d399aae6c6aad9b24a96abc860229c4a603
Author: Chris Larson <chris_larson at mentor.com>
Date: Tue Jun 8 07:46:58 2010 -0700
utils.bbclass: set close_fds=True by default for the popen helper
Signed-off-by: Chris Larson <chris_larson at mentor.com>
---
classes/relocatable.bbclass | 3 ++-
classes/utils.bbclass | 7 +++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/classes/relocatable.bbclass b/classes/relocatable.bbclass
index eb5b9e6..e4ababa 100644
--- a/classes/relocatable.bbclass
+++ b/classes/relocatable.bbclass
@@ -75,7 +75,8 @@ def process_dir (directory, d):
if len(new_rpaths):
args = ":".join(new_rpaths)
#bb.note("Setting rpath for %s to %s" %(fpath,args))
- sub.call([cmd, '-r', args, fpath])
+ oe_system(d, [cmd, '-r', args, fpath], shell=False,
+ stdout=open("/dev/null", "a"))
if perms:
os.chmod(fpath, perms)
diff --git a/classes/utils.bbclass b/classes/utils.bbclass
index 4e352e3..64d6c23 100644
--- a/classes/utils.bbclass
+++ b/classes/utils.bbclass
@@ -61,13 +61,16 @@ def oe_popen(d, cmd, **kwargs):
d.setVar("__oe_popen_env", env)
kwargs["env"] = env
+ kwargs["close_fds"] = True
kwargs["preexec_fn"] = subprocess_setup
return Popen(cmd, **kwargs)
-def oe_system(d, cmd):
+def oe_system(d, cmd, **kwargs):
""" Popen based version of os.system. """
- return oe_popen(d, cmd, shell=True).wait()
+ if not "shell" in kwargs:
+ kwargs["shell"] = True
+ return oe_popen(d, cmd, **kwargs).wait()
# for MD5/SHA handling
def base_chk_load_parser(config_paths):
More information about the Openembedded-commits
mailing list