diff options
author | jakub <jakub> | 1999-10-03 16:34:23 +0000 |
---|---|---|
committer | jakub <jakub> | 1999-10-03 16:34:23 +0000 |
commit | 24b9cebb3d36dd181cd247553e72d29e73799fc6 (patch) | |
tree | 23dcff864aa1e4e02a2b1f8e6716c832e383f694 /iutil.py | |
parent | 22822f38fcfeb133ad36625d75b7d7d050c2a560 (diff) | |
download | anaconda-24b9cebb3d36dd181cd247553e72d29e73799fc6.tar.gz anaconda-24b9cebb3d36dd181cd247553e72d29e73799fc6.tar.xz anaconda-24b9cebb3d36dd181cd247553e72d29e73799fc6.zip |
First piece of changes to make serial install possible.
More to come once I don't sit behind 14.4k modem and can do more debugging.
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -26,8 +26,12 @@ def getfd(filespec, readOnly = 0): def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2, searchPath = 0, root = '/'): stdin = getfd(stdin) - stdout = getfd(stdout) - stderr = getfd(stderr) + if stdout == stderr: + stdout = getfd(stdout) + stderr = stdout + else: + stdout = getfd(stdout) + stderr = getfd(stderr) if not os.access (root + command, os.X_OK): raise RuntimeError, command + " can not be run" @@ -48,7 +52,8 @@ def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2, os.close(stdin) if stdout != 1: os.dup2(stdout, 1) - os.close(stdout) + if stdout != stderr: + os.close(stdout) if stderr != 2: os.dup2(stderr, 2) os.close(stderr) |