From 93e20c51c4cbb345119b83a964409932af417df3 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Sun, 19 Dec 2010 19:30:49 -0700 Subject: Use os.devnull, not /dev/null (Bitbake rev: ce5ab0fc524a1c2c48c4c39d6fc8aae23019207b) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 3 +-- bitbake/lib/bb/runqueue.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 4f8ac9573..44ad3965a 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -38,8 +38,7 @@ from bb import data, event, mkdirhier, utils bblogger = logging.getLogger('BitBake') logger = logging.getLogger('BitBake.Build') -NULL = open('/dev/null', 'r') - +NULL = open(os.devnull, 'r+') # When we execute a python function we'd like certain things # in all namespaces, hence we add them to __builtins__ diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index d4cea7d5d..ee7cfe7d6 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -1140,7 +1140,7 @@ class RunQueueExecute: # Make the child the process group leader os.setpgid(0, 0) # No stdin - newsi = os.open('/dev/null', os.O_RDWR) + newsi = os.open(os.devnull, os.O_RDWR) os.dup2(newsi, sys.stdin.fileno()) # Stdout to a logfile #logout = data.expand("${TMPDIR}/log/stdout.%s" % os.getpid(), self.cfgData, True) -- cgit v1.2.3