utils.bbclass: set close_fds=True by default for the popen helper
authorChris Larson <chris_larson@mentor.com>
Tue, 8 Jun 2010 14:46:58 +0000 (07:46 -0700)
committerChris Larson <chris_larson@mentor.com>
Thu, 10 Jun 2010 18:35:01 +0000 (11:35 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
classes/relocatable.bbclass
classes/utils.bbclass

index eb5b9e6..e4ababa 100644 (file)
@@ -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)
index 4e352e3..64d6c23 100644 (file)
@@ -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):