1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 17:39:31 +00:00

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]

(From OE-Core rev: 57f843146ed62c04c23bc380dc8cb38aba264f1c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert Yang
2012-05-29 22:53:07 +08:00
committed by Richard Purdie
parent e40995e569
commit d760fb97f5
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -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)