summaryrefslogtreecommitdiff
path: root/scripts/swabber-strace-attach
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-05-29 22:53:07 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 10:56:28 +0100
commit57f843146ed62c04c23bc380dc8cb38aba264f1c (patch)
treec2c678fdf02cd54bb4f81f8f06018b3d37542344 /scripts/swabber-strace-attach
parenta07d03cc6f67c88feb9813ae7deb6e4a93552dfe (diff)
downloadopenembedded-core-57f843146ed62c04c23bc380dc8cb38aba264f1c.tar.gz
openembedded-core-57f843146ed62c04c23bc380dc8cb38aba264f1c.tar.bz2
openembedded-core-57f843146ed62c04c23bc380dc8cb38aba264f1c.zip
scripts: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would fail (more or less) silently if the executed program cannot be found More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/swabber-strace-attach')
-rwxr-xr-xscripts/swabber-strace-attach3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/swabber-strace-attach b/scripts/swabber-strace-attach
index d4f80e4e91..bb0391a7ca 100755
--- a/scripts/swabber-strace-attach
+++ b/scripts/swabber-strace-attach
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
import sys
+import subprocess
# Detach from the controlling terminal and parent process by forking twice to daemonize ourselves,
# then run the command passed as argv[1]. Send log data to argv[2].
@@ -24,7 +25,7 @@ os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
-ret = os.system(sys.argv[1])
+ret = subprocess.call(sys.argv[1], shell=True)
os._exit(ret)